Skip to content

Commit

Permalink
Icon theming moved from main to KokoVP class. Theme name are read fro…
Browse files Browse the repository at this point in the history
…m config file, empty line interprets as using system theme
  • Loading branch information
brainrom committed Sep 4, 2024
1 parent 6a06357 commit 0a94a09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions kokovp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ KokoVP::KokoVP(QWidget *parent)
assert(!inst);
inst = this;

QIcon::setFallbackThemeName("kokovp-default");

playerWidget = new PlayerWidget(this);
player = new PlayerController(playerWidget);
pref = new PrefDialog();
Expand Down Expand Up @@ -416,6 +418,10 @@ void KokoVP::readConfig()

player->setOption("alang", Config::i().get("tracks/alang").toStringList());
player->setOption("slang", Config::i().get("tracks/slang").toStringList());

QString icon_theme = Config::i().get("misc/icon_theme", "").toString();
if (!icon_theme.isEmpty())
QIcon::setThemeName(icon_theme);
}

void KokoVP::insertActionsMap(QAction *action)
Expand Down
4 changes: 0 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <QLibraryInfo>
#include <QDir>
#include <QCommandLineParser>
#include <QIcon>

#include "singleinstance.h"

Expand Down Expand Up @@ -53,9 +52,6 @@ int main(int argc, char *argv[])
if (translator.load(sysLocale, "KokoVP_", QString(), ":/i18n"))
a.installTranslator(&translator);

QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << ":/icons");
QIcon::setFallbackThemeName("kokovp-default");

SingleInstance inst("KokoVP", &a);

if (!parser.isSet(newInstanceOption))
Expand Down

0 comments on commit 0a94a09

Please sign in to comment.