[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasmate/frameworks] plasmoidviewer: Now we can choose if we want the konsolePreviewer to be
From: Antonis Tsiapaliokas <kok3rs () gmail ! com>
Date: 2014-02-20 16:52:25
Message-ID: E1WGWrJ-0007TZ-Aq () scm ! kde ! org
[Download RAW message or body]
Git commit 4de6906cb7e72c06a028e31714138b2cfd49bd7a by Antonis Tsiapaliokas.
Committed on 25/11/2013 at 09:35.
Pushed by tsiapaliokas into branch 'frameworks'.
Now we can choose if we want the konsolePreviewer to be
visible or not
M +1 -1 plasmoidviewer/main.cpp
M +2 -0 plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml
M +6 -0 plasmoidviewer/view.cpp
M +4 -1 plasmoidviewer/view.h
http://commits.kde.org/plasmate/4de6906cb7e72c06a028e31714138b2cfd49bd7a
diff --git a/plasmoidviewer/main.cpp b/plasmoidviewer/main.cpp
index c471def..792859b 100644
--- a/plasmoidviewer/main.cpp
+++ b/plasmoidviewer/main.cpp
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
parser.addVersionOption();
parser.process(app);
- View *v = new View(View::createCorona());
+ View *v = new View(View::createCorona(), false);
v->addContainment(parser.value("containment"));
v->addFormFactor(parser.value("formfactor"));
diff --git a/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml \
b/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml index dd76329..c796bca 100644
--- a/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml
+++ b/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml
@@ -62,6 +62,7 @@ Rectangle {
Konsole {
id: konsolePreviewer
z: +1
+ visible: desktop.konsoleVisible
anchors {
fill: backgroundKonsole
leftMargin: backgroundKonsole.margins.left + 8
@@ -75,6 +76,7 @@ Rectangle {
Background {
id: backgroundKonsole
+ visible: konsolePreviewer.visible
width: root.width/2
height: root.height/3
anchors.horizontalCenter: root.horizontalCenter
diff --git a/plasmoidviewer/view.cpp b/plasmoidviewer/view.cpp
index a5a65a0..74d60b0 100644
--- a/plasmoidviewer/view.cpp
+++ b/plasmoidviewer/view.cpp
@@ -34,6 +34,7 @@
View::View(Plasma::Corona *cor, QWindow *parent)
: PlasmaQuick::View(cor, parent)
{
+ m_konsoleVisible = konsoleVisible;
engine()->rootContext()->setContextProperty("desktop", this);
setSource(QUrl::fromLocalFile(cor->package().filePath("views", "Desktop.qml")));
}
@@ -162,6 +163,11 @@ void View::addLocation(const QString &location)
setLocation(locationType);
}
+bool View::konsoleVisible()
+{
+ return m_konsoleVisible;
+}
+
void View::changeLocation(int location)
{
QString locationType = "floating";
diff --git a/plasmoidviewer/view.h b/plasmoidviewer/view.h
index c20d98e..8d2495c 100644
--- a/plasmoidviewer/view.h
+++ b/plasmoidviewer/view.h
@@ -24,13 +24,15 @@
class View : public PlasmaQuick::View
{
Q_OBJECT
+ Q_PROPERTY(bool konsoleVisible READ konsoleVisible CONSTANT);
public:
- View(Plasma::Corona *corona, QWindow *parent = 0);
+ View(Plasma::Corona *corona, bool konsoleVisible, QWindow *parent = 0);
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);
@@ -40,6 +42,7 @@ public:
static Plasma::Corona *createCorona();
private:
QString m_lastAppletName;
+ bool m_konsoleVisible;
};
#endif // VIEW_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic