[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasmate/frameworks] plasmoidviewer: Implement the theme feature.
From: Antonis Tsiapaliokas <kok3rs () gmail ! com>
Date: 2014-02-20 16:52:26
Message-ID: E1WGWrK-0007TZ-0t () scm ! kde ! org
[Download RAW message or body]
Git commit 6012ad9867d1b805501b6a79c6e32d7ff2403ba1 by Antonis Tsiapaliokas.
Committed on 01/12/2013 at 18:34.
Pushed by tsiapaliokas into branch 'frameworks'.
Implement the theme feature.
Now we are able to change the theme with
plasmoidviewer --theme myTheme
M +12 -0 plasmoidviewer/main.cpp
M +2 -1 plasmoidviewer/view.h
http://commits.kde.org/plasmate/6012ad9867d1b805501b6a79c6e32d7ff2403ba1
diff --git a/plasmoidviewer/main.cpp b/plasmoidviewer/main.cpp
index 792859b..1f9c0f7 100644
--- a/plasmoidviewer/main.cpp
+++ b/plasmoidviewer/main.cpp
@@ -36,6 +36,8 @@
#include "view.h"
+#include <Plasma/Theme>
+
static const char version[] = "2.0";
int main(int argc, char **argv)
@@ -72,11 +74,21 @@ int main(int argc, char **argv)
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("p") << QStringLiteral("pixmapcache"),
i18n("The size in kB to set the pixmap cache to"),
QStringLiteral("size")));
+ parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("t") << QStringLiteral("theme"),
+ i18n("The name of the theme which the shell will use"),
+ QStringLiteral("themeName")));
+
parser.addHelpOption();
parser.addVersionOption();
parser.process(app);
+ Plasma::Theme theme;
+ if (parser.isSet("theme")) {
+ theme.setThemeName(parser.value("theme"));
+ theme.setUseGlobalSettings(false);
+ }
+
View *v = new View(View::createCorona(), false);
v->addContainment(parser.value("containment"));
diff --git a/plasmoidviewer/view.h b/plasmoidviewer/view.h
index 8d2495c..343c7f4 100644
--- a/plasmoidviewer/view.h
+++ b/plasmoidviewer/view.h
@@ -28,12 +28,13 @@ class View : public PlasmaQuick::View
public:
View(Plasma::Corona *corona, bool konsoleVisible, QWindow *parent = 0);
+ ~View();
+
void addApplet(const QString &applet);
void addContainment(const QString &containment);
void addFormFactor(const QString &formFactor = "planar");
void addLocation(const QString &location = "floating");
bool konsoleVisible();
- ~View();
Q_INVOKABLE void changeFormFactor(int formFactor);
Q_INVOKABLE void changeLocation(int location);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic