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

List:       kde-cygwin
Subject:    [PATCH] Correct color for disabled Buttons
From:       Christian Ehrlicher <Ch.Ehrlicher () gmx ! de>
Date:       2004-09-27 19:28:32
Message-ID: 415869E0.20000 () gmx ! de
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Disabled buttons (and backgrounds) were displayed in a wrong color.
Fixed by setting QPalette::Disabled for
QColorGroup::Button/QColorGroup::Background to the same color as
QPalette::Enabled which is imho the correct value since only the text
gets greyed out.
But this doesn't fix the problem that a disabled QActionlabel isn't
showed  - see examples/action/toggleaction (insert
"labelonoffaction->setEnabled(false);" to see the problem).

Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBWGngnNKwkgf+zVMRApHQAJ0ZlrYhcfXhd6FoIQux5fsKhan9RwCeO4rL
XfsgJuFJdNlIWSRf+0qtjwc=
=yZpc
-----END PGP SIGNATURE-----

["qapplication_win.cpp.patch" (text/plain)]

Index: src/kernel/qapplication_win.cpp
===================================================================
RCS file: /cvsroot/kde-cygwin/qt-3/src/kernel/Attic/qapplication_win.cpp,v
retrieving revision 1.1.2.30.2.7
diff -u -r1.1.2.30.2.7 qapplication_win.cpp
--- src/kernel/qapplication_win.cpp	25 Sep 2004 12:12:00 -0000	1.1.2.30.2.7
+++ src/kernel/qapplication_win.cpp	27 Sep 2004 19:16:36 -0000
@@ -722,18 +722,23 @@
     QPalette pal = QApplication::palette();
 
     c = GetSysColor( COLOR_BTNFACE );
-    pal.setBrush( QPalette::Active, QColorGroup::Background, QColor( GetRValue( c ), \
                GetGValue( c ), GetBValue( c ) ) );
-    pal.setBrush( QPalette::Inactive, QColorGroup::Background, QColor( GetRValue( c \
                ), GetGValue( c ), GetBValue( c ) ) );
-    pal.setBrush( QPalette::Active, QColorGroup::Button, QColor( GetRValue( c ), \
                GetGValue( c ), GetBValue( c ) ) );
-    pal.setBrush( QPalette::Inactive, QColorGroup::Button, QColor( GetRValue( c ), \
GetGValue( c ), GetBValue( c ) ) ); +    qc = QColor( GetRValue( c ), GetGValue( c ), \
GetBValue( c ) ); +    pal.setBrush( QPalette::Active, QColorGroup::Background, qc );
+    pal.setBrush( QPalette::Inactive, QColorGroup::Background, qc );
+    pal.setBrush( QPalette::Disabled, QColorGroup::Background, qc );
+    pal.setBrush( QPalette::Active, QColorGroup::Button, qc );
+    pal.setBrush( QPalette::Inactive, QColorGroup::Button, qc );
+    pal.setBrush( QPalette::Disabled, QColorGroup::Button, qc );
 
     c = GetSysColor( COLOR_HIGHLIGHT );
-    pal.setBrush( QPalette::Active, QColorGroup::Highlight, QColor( GetRValue( c ), \
                GetGValue( c ), GetBValue( c ) ) );
-    pal.setBrush( QPalette::Inactive, QColorGroup::Highlight, QColor( GetRValue( c \
), GetGValue( c ), GetBValue( c ) ) ); +    qc = QColor( GetRValue( c ), GetGValue( c \
), GetBValue( c ) ); +    pal.setBrush( QPalette::Active, QColorGroup::Highlight, qc \
); +    pal.setBrush( QPalette::Inactive, QColorGroup::Highlight, qc );
 
     c = GetSysColor( COLOR_3DDKSHADOW );
-    pal.setBrush( QPalette::Active, QColorGroup::Shadow, QColor( GetRValue( c ), \
                GetGValue( c ), GetBValue( c ) ) );
-    pal.setBrush( QPalette::Inactive, QColorGroup::Shadow, QColor( GetRValue( c ), \
GetGValue( c ), GetBValue( c ) ) ); +    qc = QColor( GetRValue( c ), GetGValue( c ), \
GetBValue( c ) ); +    pal.setBrush( QPalette::Active, QColorGroup::Shadow, qc );
+    pal.setBrush( QPalette::Inactive, QColorGroup::Shadow, qc );
 
     c = GetSysColor( COLOR_WINDOWTEXT );
     qc = QColor( GetRValue( c ), GetGValue( c ), GetBValue( c ) );
@@ -5830,7 +5835,6 @@
     return appDisplay;
 }
 
-
 Qt::WindowsVersion QApplication::winVersion()
 {
     return qt_winver;



_______________________________________________
kde-cygwin mailing list
kde-cygwin@kde.org
https://mail.kde.org/mailman/listinfo/kde-cygwin


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

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