custom theme if standalone app

wilder-5.14
Marco Martin 12 years ago
parent fa62974dcb
commit c3934b129b
  1. 5
      shell/main.cpp
  2. 40
      shell/shellcorona.cpp

@ -129,12 +129,15 @@ int main(int argc, char *argv[])
}
if (cliOptions.isSet(standaloneOption)) {
ShellManager::s_standaloneOption += " -a";
ShellManager::s_restartOptions += " -a";
}
if (cliOptions.isSet(standaloneOption) && cliOptions.isSet(shellPluginOption)) {
ShellManager::s_standaloneOption = true;
app.setApplicationName("plasmashell_"+cliOptions.value(shellPluginOption));
Plasma::Theme theme;
theme.setUseGlobalSettings(false);
KDBusService service(KDBusService::Unique);
ShellCorona *corona = new ShellCorona;
corona->setShell(cliOptions.value(shellPluginOption));

@ -123,26 +123,28 @@ ShellCorona::ShellCorona(QObject *parent)
saveLayout();
});
const QString themeGroupKey = QStringLiteral("Theme");
const QString themeNameKey = QStringLiteral("name");
QString themeName;
KConfigGroup plasmarc(KSharedConfig::openConfig("plasmarc"), themeGroupKey);
themeName = plasmarc.readEntry(themeNameKey, themeName);
if (themeName.isEmpty()) {
KConfigGroup lnfCfg = KConfigGroup(KSharedConfig::openConfig(
m_lookAndFeelPackage.filePath("defaults")),
"plasmarc"
);
lnfCfg = KConfigGroup(&lnfCfg, themeGroupKey);
themeName = lnfCfg.readEntry(themeNameKey, themeName);
}
if (!ShellManager::s_standaloneOption) {
const QString themeGroupKey = QStringLiteral("Theme");
const QString themeNameKey = QStringLiteral("name");
QString themeName;
KConfigGroup plasmarc(KSharedConfig::openConfig("plasmarc"), themeGroupKey);
themeName = plasmarc.readEntry(themeNameKey, themeName);
if (themeName.isEmpty()) {
KConfigGroup lnfCfg = KConfigGroup(KSharedConfig::openConfig(
m_lookAndFeelPackage.filePath("defaults")),
"plasmarc"
);
lnfCfg = KConfigGroup(&lnfCfg, themeGroupKey);
themeName = lnfCfg.readEntry(themeNameKey, themeName);
}
if (!themeName.isEmpty()) {
Plasma::Theme *t = new Plasma::Theme(this);
t->setThemeName(themeName);
if (!themeName.isEmpty()) {
Plasma::Theme *t = new Plasma::Theme(this);
t->setThemeName(themeName);
}
}
connect(this, &ShellCorona::containmentAdded,

Loading…
Cancel
Save