mirror of
https://github.com/opentx/opentx.git
synced 2025-07-21 07:15:12 +03:00
Remove duplicated code
This commit is contained in:
parent
034130555e
commit
fad6211789
16 changed files with 42 additions and 262 deletions
|
@ -1485,9 +1485,26 @@ QString getCenterBeep(ModelData * g_model)
|
|||
return strl.join(", ");
|
||||
}
|
||||
|
||||
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage) {
|
||||
void populate_icon(QIcon *Icon, QString usedtheme, QString baseimage)
|
||||
{
|
||||
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();
|
||||
QString Theme;
|
||||
switch(theme_set) {
|
||||
case 0:
|
||||
Theme="classic";
|
||||
break;
|
||||
default:
|
||||
Theme="monochrome";
|
||||
break;
|
||||
}
|
||||
return Theme;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue