[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasmate/frameworks] plasmoidviewer: Make the location able to be changed inside from the qml
From: Antonis Tsiapaliokas <kok3rs () gmail ! com>
Date: 2014-02-20 16:52:20
Message-ID: E1WGWrE-0007TZ-O7 () scm ! kde ! org
[Download RAW message or body]
Git commit 908dec69ff6cc257f0a763f4f376971c33527680 by Antonis Tsiapaliokas.
Committed on 06/11/2013 at 12:50.
Pushed by tsiapaliokas into branch 'frameworks'.
Make the location able to be changed inside from the qml
M +3 -0 plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml
M +10 -2 plasmoidviewer/qmlpackages/shell/contents/views/SdkButtons.qml
M +30 -0 plasmoidviewer/view.cpp
M +2 -0 plasmoidviewer/view.h
http://commits.kde.org/plasmate/908dec69ff6cc257f0a763f4f376971c33527680
diff --git a/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml \
b/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml index 6198695..c19a833 \
100644
--- a/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml
+++ b/plasmoidviewer/qmlpackages/shell/contents/views/Desktop.qml
@@ -44,6 +44,9 @@ Rectangle {
onFormFactor: {
desktop.changeFormFactor(FormFactorType)
}
+ onLocation: {
+ desktop.changeLocation(LocationType)
+ }
}
Background {
diff --git a/plasmoidviewer/qmlpackages/shell/contents/views/SdkButtons.qml \
b/plasmoidviewer/qmlpackages/shell/contents/views/SdkButtons.qml index \
e7ffd55..eebaf32 100644
--- a/plasmoidviewer/qmlpackages/shell/contents/views/SdkButtons.qml
+++ b/plasmoidviewer/qmlpackages/shell/contents/views/SdkButtons.qml
@@ -26,6 +26,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
id: root
signal formFactor(int FormFactorType)
+ signal location(int LocationType)
RowLayout {
id: buttonRow
@@ -80,24 +81,31 @@ Item {
id: locationMenu
PlasmaComponents.MenuItem {
text: i18n("Floating")
+ onClicked: location(PlasmaCore.Types.Floating)
}
PlasmaComponents.MenuItem {
text: i18n("Desktop")
+ onClicked: location(PlasmaCore.Types.Desktop)
}
PlasmaComponents.MenuItem {
text: i18n("Fullscreen")
+ onClicked: location(PlasmaCore.Types.FullScreen)
}
PlasmaComponents.MenuItem {
text: i18n("Topedge")
+ onClicked: location(PlasmaCore.Types.TopEdge)
}
PlasmaComponents.MenuItem {
- text: i18n("Bottomedget")
+ text: i18n("Bottomedge")
+ onClicked: location(PlasmaCore.Types.Bottomedge)
}
PlasmaComponents.MenuItem {
- text: i18n("Leftedget")
+ text: i18n("Leftedge")
+ onClicked: location(PlasmaCore.Types.LeftEdge)
}
PlasmaComponents.MenuItem {
text: i18n("Rightedget")
+ onClicked: location(PlasmaCore.Types.RightEdge)
}
}
}
diff --git a/plasmoidviewer/view.cpp b/plasmoidviewer/view.cpp
index 067ac49..a825d9d 100644
--- a/plasmoidviewer/view.cpp
+++ b/plasmoidviewer/view.cpp
@@ -148,6 +148,36 @@ void View::addLocation(const QString &location)
setLocation(locationType);
}
+void View::changeLocation(int location)
+{
+ QString locationType = "floating";
+ switch (location) {
+ case Plasma::Types::Floating:
+ locationType = "floating";
+ break;
+ case Plasma::Types::Desktop:
+ locationType = "desktop";
+ break;
+ case Plasma::Types::FullScreen:
+ locationType = "fullscreen";
+ break;
+ case Plasma::Types::TopEdge:
+ locationType = "topedge";
+ break;
+ case Plasma::Types::BottomEdge:
+ locationType = "bottomedge";
+ break;
+ case Plasma::Types::RightEdge:
+ locationType = "rightedge";
+ break;
+ case Plasma::Types::LeftEdge:
+ locationType = "leftedge";
+ break;
+ }
+
+ addLocation(locationType);
+}
+
Plasma::Corona *View::createCorona()
{
Plasma::Package package = \
Plasma::PluginLoader::self()->loadPackage("Plasma/Shell");
diff --git a/plasmoidviewer/view.h b/plasmoidviewer/view.h
index c376efd..669ffa8 100644
--- a/plasmoidviewer/view.h
+++ b/plasmoidviewer/view.h
@@ -34,6 +34,8 @@ public:
~View();
Q_INVOKABLE void changeFormFactor(int formFactor);
+ Q_INVOKABLE void changeLocation(int location);
+
static Plasma::Corona *createCorona();
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic