Enable RDStyle by default, add style selection in the settings dialog

This commit is contained in:
baldurk
2017-08-16 17:39:37 +01:00
parent b70e897838
commit cfd816d7f3
11 changed files with 291 additions and 26 deletions
+20
View File
@@ -166,6 +166,26 @@ int main(int argc, char *argv[])
config.SetupFormatting();
bool isDarkTheme = false;
{
float baseLum = getLuminance(application.palette().color(QPalette::Base));
float textLum = getLuminance(application.palette().color(QPalette::Text));
// if the base is dark than the text, then it's a light-on-dark theme (aka dark theme)
isDarkTheme = (baseLum < textLum);
}
bool styleSet = config.SetStyle();
// unrecognised style, or empty (none set), choose a default
if(!styleSet)
{
config.UIStyle = isDarkTheme ? lit("RDDark") : lit("RDLight");
config.SetStyle();
}
Resources::Initialise();
GUIInvoke::init();