[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-mediacenter/PMC/0.9] shells/newshell: Let the user control fullscreen.
From:       Shantanu Tushar <shaan7in () gmail ! com>
Date:       2012-04-19 15:10:22
Message-ID: 20120419151022.ED59FA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 07ce691e9fa6878c4d8bd946d077c28abc3d2229 by Shantanu Tushar.
Committed on 19/04/2012 at 17:08.
Pushed by shantanu into branch 'PMC/0.9'.

Let the user control fullscreen.
Patch by Nancy nancydsce@gmail.com . Welcome to KDE :)

REVIEW: 104612

M  +2    -1    shells/newshell/mainwindow.cpp
M  +1    -1    shells/newshell/mainwindow.h
M  +18   -0    shells/newshell/package/contents/ui/mediacenter.qml

http://commits.kde.org/plasma-mediacenter/07ce691e9fa6878c4d8bd946d077c28abc3d2229

diff --git a/shells/newshell/mainwindow.cpp b/shells/newshell/mainwindow.cpp
index bfafc34..0d637f0 100644
--- a/shells/newshell/mainwindow.cpp
+++ b/shells/newshell/mainwindow.cpp
@@ -69,13 +69,14 @@ MainWindow::MainWindow(QWidget *parent) : KMainWindow(parent)
     resize(1024, 768);
 }
 
-void MainWindow::toggleFullScreen()
+bool MainWindow::toggleFullScreen()
 {
     if (windowState() & Qt::WindowFullScreen) {
         setWindowState(windowState() & ~Qt::WindowFullScreen);
     } else {
         setWindowState(windowState() | Qt::WindowFullScreen);
     }
+    return (windowState() & Qt::WindowFullScreen);
 }
 
 MainWindow::~MainWindow()
diff --git a/shells/newshell/mainwindow.h b/shells/newshell/mainwindow.h
index d6d4405..b43a954 100644
--- a/shells/newshell/mainwindow.h
+++ b/shells/newshell/mainwindow.h
@@ -33,7 +33,7 @@ public:
     Q_INVOKABLE void closeMediaCenter();
 
 public Q_SLOTS:
-    void toggleFullScreen();
+    Q_INVOKABLE bool toggleFullScreen();
 
 private:
     Plasma::PackageStructure::Ptr m_structure;
diff --git a/shells/newshell/package/contents/ui/mediacenter.qml \
b/shells/newshell/package/contents/ui/mediacenter.qml index d2b63e1..1f80f20 100644
--- a/shells/newshell/package/contents/ui/mediacenter.qml
+++ b/shells/newshell/package/contents/ui/mediacenter.qml
@@ -162,4 +162,22 @@ Rectangle {
         iconSource: "plasma"
         onClicked: aboutPmc.open()
     }
+
+    PlasmaComponents.ToolButton {
+        anchors.right: parent.right; anchors.top: parent.top;
+        width: 64
+        height: 64
+
+        property bool fullScreen
+
+        iconSource: "view-fullscreen"
+        onClicked: {
+            fullScreen =  mainwindow.toggleFullScreen();
+            if(fullScreen) {
+                iconSource = "view-restore"
+            } else {
+                iconSource = "view-fullscreen"
+            }
+        }
+    }
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic