From e81bbc1dabc3601876bd7393c73b49d5ff87ee85 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 27 Sep 2013 12:52:01 -0300 Subject: Hack to make the subsurface work on Gnome3 shell The Gtk+ style on the Gnome shell is somewhat broken on Qt for some reason. This hack pokes the system, checks if it's running gnome-shell, and if the current style is gtk+ ( I couldn't just check for gtk+ since it worked on XFCE and other Gtk based enviro ments. so a double check is needed. ) then I changed the Pallete of the affected widgets by hand. not a pretty hack but worked. [Dirk Hohndel: redid the patch to be simpler and more consistent] Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/modeldelegates.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'qt-ui/modeldelegates.cpp') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 5a55cad3c..6141f79fc 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -4,6 +4,7 @@ #include "starwidget.h" #include "models.h" #include "diveplanner.h" +#include "simplewidgets.h" #include #include @@ -16,6 +17,7 @@ #include #include #include +#include // Gets the index of the model in the currentRow and column. // currCombo is defined below. @@ -100,6 +102,16 @@ QWidget* ComboBoxDelegate::createEditor(QWidget* parent, const QStyleOptionViewI currCombo.comboEditor = comboDelegate; currCombo.currRow = index.row(); currCombo.model = const_cast(index.model()); + + // Current display of things on Gnome3 looks like shit, so + // let`s fix that. + if (isGnome3Session()) { + QPalette p; + p.setColor(QPalette::Window, QColor(Qt::white)); + p.setColor(QPalette::Base, QColor(Qt::white)); + comboDelegate->lineEdit()->setPalette(p); + comboDelegate->setPalette(p); + } return comboDelegate; } -- cgit v1.2.3-70-g09d2