forked from qt-creator/qt-creator
Force custom colors within usable range
We previously allowed fully white and yellow colors as the base color for our interface. This does not work with our icons or other interface elements. Instead I now constrain the selectable colors within a certain range of saturation and brightness. This still leaves the user in control but will prevent the common case where the user selects an overly saturated color from the color picker and ends up with an unusable or extremely ugly panel.
This commit is contained in:
@@ -1131,7 +1131,7 @@ void MainWindow::writeSettings()
|
||||
m_settings->beginGroup(QLatin1String(settingsGroup));
|
||||
|
||||
if (!(m_overrideColor.isValid() && Utils::StyleHelper::baseColor() == m_overrideColor))
|
||||
m_settings->setValue(QLatin1String(colorKey), Utils::StyleHelper::baseColor());
|
||||
m_settings->setValue(QLatin1String(colorKey), Utils::StyleHelper::requestedBaseColor());
|
||||
|
||||
if (windowState() & (Qt::WindowMaximized | Qt::WindowFullScreen)) {
|
||||
m_settings->setValue(QLatin1String(maxKey), (bool) (windowState() & Qt::WindowMaximized));
|
||||
|
||||
Reference in New Issue
Block a user