summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libs/utils/stylehelper.cpp5
-rw-r--r--src/libs/utils/stylehelper.h2
-rw-r--r--src/plugins/coreplugin/generalsettings.cpp2
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp4
4 files changed, 9 insertions, 4 deletions
diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp
index 8f6499ce3c..d6a5d54646 100644
--- a/src/libs/utils/stylehelper.cpp
+++ b/src/libs/utils/stylehelper.cpp
@@ -94,8 +94,9 @@ QColor StyleHelper::panelTextColor(bool lightColored)
return Qt::black;
}
-QColor StyleHelper::m_baseColor(0x666666);
-QColor StyleHelper::m_requestedBaseColor(0x666666);
+// Invalid by default, setBaseColor needs to be called at least once
+QColor StyleHelper::m_baseColor;
+QColor StyleHelper::m_requestedBaseColor;
QColor StyleHelper::baseColor(bool lightColored)
{
diff --git a/src/libs/utils/stylehelper.h b/src/libs/utils/stylehelper.h
index 5533691acf..75435c4f88 100644
--- a/src/libs/utils/stylehelper.h
+++ b/src/libs/utils/stylehelper.h
@@ -50,6 +50,8 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT StyleHelper
{
public:
+ static const unsigned int DEFAULT_BASE_COLOR = 0x666666;
+
// Height of the project explorer navigation bar
static int navigationWidgetHeight() { return 24; }
static qreal sidebarFontSize();
diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp
index a9953bad69..12a719a1e8 100644
--- a/src/plugins/coreplugin/generalsettings.cpp
+++ b/src/plugins/coreplugin/generalsettings.cpp
@@ -237,7 +237,7 @@ void GeneralSettings::finish()
void GeneralSettings::resetInterfaceColor()
{
- m_page->colorButton->setColor(0x666666);
+ m_page->colorButton->setColor(StyleHelper::DEFAULT_BASE_COLOR);
}
void GeneralSettings::resetExternalEditor()
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 201105098f..ed1d48afb8 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -1130,7 +1130,9 @@ void MainWindow::readSettings()
// Get adapted base color.
m_overrideColor = Utils::StyleHelper::baseColor();
} else {
- Utils::StyleHelper::setBaseColor(m_settings->value(QLatin1String(colorKey)).value<QColor>());
+ Utils::StyleHelper::setBaseColor(
+ m_settings->value(QLatin1String(colorKey),
+ QColor(Utils::StyleHelper::DEFAULT_BASE_COLOR)).value<QColor>());
}
const QVariant geom = m_settings->value(QLatin1String(geometryKey));