Another code reduction. Settings are now stored in "OpenTX/Companion",
instead of "companion/companion"
This commit is contained in:
+13
-12
@@ -1485,19 +1485,10 @@ QString getCenterBeep(ModelData * g_model)
|
||||
return strl.join(", ");
|
||||
}
|
||||
|
||||
void populate_icon(QIcon *Icon, QString baseimage)
|
||||
{
|
||||
static QString usedtheme=getTheme();
|
||||
Icon->addFile(":/themes/"+usedtheme+"/16/"+baseimage,QSize(16,16));
|
||||
Icon->addFile(":/themes/"+usedtheme+"/24/"+baseimage,QSize(24,24));
|
||||
Icon->addFile(":/themes/"+usedtheme+"/32/"+baseimage,QSize(32,32));
|
||||
Icon->addFile(":/themes/"+usedtheme+"/48/"+baseimage,QSize(48,48));
|
||||
}
|
||||
|
||||
QString getTheme()
|
||||
{
|
||||
QSettings settings("companion", "companion");
|
||||
int theme_set=settings.value("theme", 1).toInt();
|
||||
QSettings settings;
|
||||
int theme_set = settings.value("theme", 1).toInt();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
@@ -1508,4 +1499,14 @@ QString getTheme()
|
||||
break;
|
||||
}
|
||||
return Theme;
|
||||
}
|
||||
}
|
||||
|
||||
CompanionIcon::CompanionIcon(QString baseimage)
|
||||
{
|
||||
static QString theme = getTheme();
|
||||
addFile(":/themes/"+theme+"/16/"+baseimage, QSize(16,16));
|
||||
addFile(":/themes/"+theme+"/24/"+baseimage, QSize(24,24));
|
||||
addFile(":/themes/"+theme+"/32/"+baseimage, QSize(32,32));
|
||||
addFile(":/themes/"+theme+"/48/"+baseimage, QSize(48,48));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user