Skip to content
Snippets Groups Projects
Commit d673651f authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

uniform order: light < dark

parent d28df288
No related branches found
No related tags found
1 merge request!2095reconnect body of group boxes in mask properties editor (#814)
......@@ -256,8 +256,8 @@ void ActionManager::onAboutToShowSettingsMenu()
styleMenu->addAction(action);
};
addStyleAction("Dark style", ApplicationSettings::Style::dark);
addStyleAction("Light style", ApplicationSettings::Style::light);
addStyleAction("Dark style", ApplicationSettings::Style::dark);
}
void ActionManager::onAboutToShowViewMenu()
......
......@@ -136,43 +136,33 @@ void ApplicationSettings::loadStyle(ApplicationSettings::Style style)
base.open(QFile::ReadOnly);
QString stylesheet = base.readAll();
switch (style) {
case ApplicationSettings::Style::dark: {
QFile dark(":/styles/Dark.stylesheet");
dark.open(QFile::ReadOnly);
stylesheet += dark.readAll();
break;
}
case ApplicationSettings::Style::light:
default: {
QFile light(":/styles/Light.stylesheet");
light.open(QFile::ReadOnly);
stylesheet += light.readAll();
break;
}
}
if (style == ApplicationSettings::Style::light) {
QFile f(":/styles/Light.stylesheet");
f.open(QFile::ReadOnly);
stylesheet += f.readAll();
} else if (style == ApplicationSettings::Style::dark) {
QFile f(":/styles/Dark.stylesheet");
f.open(QFile::ReadOnly);
stylesheet += f.readAll();
} else
ASSERT_NEVER;
m_currentStyle = style;
QPalette styleSheetPalette = qApp->style()->standardPalette();
// -- init palette for later usage; could be improved by parsing the stylesheet
switch (m_currentStyle) {
case ApplicationSettings::Style::light: {
if (m_currentStyle == ApplicationSettings::Style::light) {
styleSheetPalette.setColor(QPalette::Text, Qt::black);
styleSheetPalette.setColor(QPalette::WindowText, Qt::black);
styleSheetPalette.setColor(QPalette::Base, Qt::white);
styleSheetPalette.setColor(QPalette::AlternateBase, QColor(255, 255, 255).darker(105));
styleSheetPalette.setColor(QPalette::Dark, QColor(255, 255, 255).darker(110));
break;
}
case ApplicationSettings::Style::dark: {
} else if (m_currentStyle == ApplicationSettings::Style::dark) {
styleSheetPalette.setColor(QPalette::Text, QColor(213, 220, 223));
styleSheetPalette.setColor(QPalette::WindowText, QColor(213, 220, 223));
styleSheetPalette.setColor(QPalette::Base, QColor(43, 50, 54));
styleSheetPalette.setColor(QPalette::AlternateBase, QColor(43, 50, 54).darker(130));
styleSheetPalette.setColor(QPalette::Dark, QColor(43, 50, 54).darker(120));
break;
}
}
QApplication::setPalette(styleSheetPalette);
qApp->setStyleSheet("");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment