forked from qt-creator/qt-creator
Fixes: Set alternate base on light themes
Details: Not all themes have ok contrast for alternate base and we want to keep it light, so I'm enforcing it for themes with white background.
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QFocusEvent>
|
||||
#include <QtGui/QPalette>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
@@ -74,6 +75,11 @@ public:
|
||||
setUniformRowHeights(true);
|
||||
setTextElideMode(Qt::ElideNone);
|
||||
setAlternatingRowColors(true);
|
||||
QPalette pal = palette();
|
||||
if (pal.base().color() == Qt::white) { // Leave dark themes as they are
|
||||
pal.setBrush(QPalette::AlternateBase, QColor(239, 239, 239));
|
||||
setPalette(pal);
|
||||
}
|
||||
setProperty("AlternateEmpty", true); // Let Manhattan to override style default
|
||||
// setExpandsOnDoubleClick(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user