diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-06 12:17:15 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-04-06 12:19:48 (GMT) |
commit | f06c4f2d7378b40a0a184393a8986032d5a700ee (patch) | |
tree | 1ec9acc80ac8082b2de8891c1bf264da6af75417 /src/gui | |
parent | cc18633fe45d599bfeac2a8b2737d155f1dd5564 (diff) | |
download | Qt-f06c4f2d7378b40a0a184393a8986032d5a700ee.zip Qt-f06c4f2d7378b40a0a184393a8986032d5a700ee.tar.gz Qt-f06c4f2d7378b40a0a184393a8986032d5a700ee.tar.bz2 |
BT: Fix combobox background color regression
There was a regression in the background color for QComboBox popups.
This should resolve it. It essentially tells the system to stay off
the system palette while QGtkStyle is used. We will introduce
a cleaner style hint for this in 4.6.
Reviewed-by: nrc
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 6 | ||||
-rw-r--r-- | src/gui/styles/gtksymbols.cpp | 8 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 10fb886..b1270bc 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -1362,8 +1362,10 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0, pal.setColor(QPalette::Disabled, QPalette::Highlight, Qt::darkBlue); } - QApplicationPrivate::setSystemPalette(pal); - + // QGtkStyle sets it's own system palette + if (!(QApplicationPrivate::app_style && QApplicationPrivate::app_style->inherits("QGtkStyle"))) { + QApplicationPrivate::setSystemPalette(pal); + } QColor::setAllowX11ColorNames(allowX11ColorNames); } diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index 8123d32..f7af8f8 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -504,13 +504,6 @@ static QPalette gtkWidgetPalette(const QString >kWidgetName) pal.setBrush(QPalette::Disabled, QPalette::WindowText, disabledTextColor); pal.setBrush(QPalette::All, QPalette::ButtonText, textColor); pal.setBrush(QPalette::Disabled, QPalette::ButtonText, disabledTextColor); - if (gtkWidgetName == QLS("GtkMenu")) { - // This really applies to the combo box rendering since - // QComboBox copies the palette from a QMenu - GdkColor gdkBg = gtkWidget->style->bg[GTK_STATE_NORMAL]; - QColor bgColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); - pal.setBrush(QPalette::Base, bgColor); - } return pal; } @@ -528,6 +521,7 @@ void QGtk::applyCustomPaletteHash() GdkColor gdkBg = QGtk::gtkWidget(QLS("GtkMenu"))->style->bg[GTK_STATE_NORMAL]; QColor bgColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); menuPal.setBrush(QPalette::Base, bgColor); + menuPal.setBrush(QPalette::Window, bgColor); qApp->setPalette(menuPal, "QMenu"); QPalette toolbarPal = gtkWidgetPalette(QLS("GtkToolbar")); |