More flexible dark scheme handling
It works now as follows: 1) try to get theme information from the system, and if present us it. 2) if no theme information of the system is present, take the one from the musredit_startup.xml. Now it is possible to switch the icon theme for the menu and toolbar separately.
This commit is contained in:
@@ -94,8 +94,10 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
|
||||
fKeyWord = eMusrviewShowAvg;
|
||||
} else if (qName == "enable_musrt0") {
|
||||
fKeyWord = eEnableMusrT0;
|
||||
} else if (qName == "dark_theme_icons") {
|
||||
fKeyWord = eDarkThemeIcons;
|
||||
} else if (qName == "dark_theme_icons_menu") {
|
||||
fKeyWord = eDarkThemeIconsMenu;
|
||||
} else if (qName == "dark_theme_icons_toolbar") {
|
||||
fKeyWord = eDarkThemeIconsToolbar;
|
||||
} else if (qName == "keep_minuit2_output") {
|
||||
fKeyWord = eKeepMinuit2Output;
|
||||
} else if (qName == "dump_ascii") {
|
||||
@@ -270,12 +272,19 @@ bool PAdminXMLParser::characters(const QString& str)
|
||||
flag = false;
|
||||
fAdmin->setEnableMusrT0Flag(flag);
|
||||
break;
|
||||
case eDarkThemeIcons:
|
||||
case eDarkThemeIconsMenu:
|
||||
if (str == "y")
|
||||
flag = true;
|
||||
else
|
||||
flag = false;
|
||||
fAdmin->setDarkThemeIconsFlag(flag);
|
||||
fAdmin->setDarkThemeIconsMenuFlag(flag);
|
||||
break;
|
||||
case eDarkThemeIconsToolbar:
|
||||
if (str == "y")
|
||||
flag = true;
|
||||
else
|
||||
flag = false;
|
||||
fAdmin->setDarkThemeIconsToolbarFlag(flag);
|
||||
break;
|
||||
case eKeepMinuit2Output:
|
||||
if (str == "y")
|
||||
@@ -876,11 +885,17 @@ int PAdmin::savePrefs(QString pref_fln)
|
||||
else
|
||||
data[i] = " <enable_musrt0>n</enable_musrt0>";
|
||||
}
|
||||
if (data[i].contains("<dark_theme_icons>") && data[i].contains("</dark_theme_icons>")) {
|
||||
if (fDarkThemeIcons)
|
||||
data[i] = " <dark_theme_icons>y</dark_theme_icons>";
|
||||
if (data[i].contains("<dark_theme_icons_menu>") && data[i].contains("</dark_theme_icons_menu>")) {
|
||||
if (fDarkThemeIconsMenu)
|
||||
data[i] = " <dark_theme_icons_menu>y</dark_theme_icons_menu>";
|
||||
else
|
||||
data[i] = " <dark_theme_icons>n</dark_theme_icons>";
|
||||
data[i] = " <dark_theme_icons_menu>n</dark_theme_icons_menu>";
|
||||
}
|
||||
if (data[i].contains("<dark_theme_icons_toolbar>") && data[i].contains("</dark_theme_icons_toolbar>")) {
|
||||
if (fDarkThemeIconsToolbar)
|
||||
data[i] = " <dark_theme_icons_toolbar>y</dark_theme_icons_toolbar>";
|
||||
else
|
||||
data[i] = " <dark_theme_icons_toolbar>n</dark_theme_icons_toolbar>";
|
||||
}
|
||||
if (data[i].contains("<font_name>") && data[i].contains("</font_name>")) {
|
||||
data[i] = QString(" <font_name>%1</font_name>").arg(fFontName);
|
||||
|
||||
Reference in New Issue
Block a user