[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/libs/kotext/styles
From:       Pavol Korinek <pavol.korinek () ixonos ! com>
Date:       2010-05-19 7:34:57
Message-ID: 20100519073457.32C3EAC8BA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1128387 by pavolk:

highlighting and font view color change on dark background

 M  +5 -1      KoCharacterStyle.cpp  


--- trunk/koffice/libs/kotext/styles/KoCharacterStyle.cpp #1128386:1128387
@@ -1096,14 +1096,18 @@
     if (styleStack.hasProperty(KoXmlNS::style, "use-window-font-color")) {
         if (styleStack.property(KoXmlNS::style, "use-window-font-color") == "true") \
                {
             // Do like OpenOffice.org : change the foreground font if its color is \
too close to the background color... +            
             QColor back = background().color();
             QColor front = foreground().color();
-            if ((abs(qGray(back.rgb()) - qGray(front.rgb())) < 10) && \
(background().style() != Qt::NoBrush) && (foreground().style() != Qt::NoBrush)) { +   \
if ((abs(qGray(back.rgb()) - qGray(front.rgb())) < 10) && (background().style() != \
Qt::NoBrush)) {  front.setRed(255 - front.red());
                 front.setGreen(255 - front.green());
                 front.setBlue(255 - front.blue());
                 QBrush frontBrush = foreground();
                 frontBrush.setColor(front);
+                if (frontBrush.style() == Qt::NoBrush) {
+                    frontBrush.setStyle(Qt::SolidPattern);
+                }
                 setForeground(frontBrush);
             }
         }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic