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

List:       kde-commits
Subject:    [kde-workspace/plasma/sreich/sal-qml] plasma/netbook/containments/sal/shell: show a close button abo
From:       Shaun Reich <shaun.reich () kdemail ! net>
Date:       2012-04-15 23:15:27
Message-ID: 20120415231527.C0863A60CE () git ! kde ! org
[Download RAW message or body]

Git commit e0acef2d361ef89b3500c3aa2821ce3b3cebcd6c by Shaun Reich.
Committed on 12/04/2012 at 20:50.
Pushed by sreich into branch 'plasma/sreich/sal-qml'.

show a close button above the window/widget contents

M  +11   -4    plasma/netbook/containments/sal/shell/fullview.cpp
M  +2    -0    plasma/netbook/containments/sal/shell/fullview.h

http://commits.kde.org/kde-workspace/e0acef2d361ef89b3500c3aa2821ce3b3cebcd6c

diff --git a/plasma/netbook/containments/sal/shell/fullview.cpp \
b/plasma/netbook/containments/sal/shell/fullview.cpp index a5a6f04..8b68ffb 100644
--- a/plasma/netbook/containments/sal/shell/fullview.cpp
+++ b/plasma/netbook/containments/sal/shell/fullview.cpp
@@ -48,6 +48,7 @@
 #include <Plasma/Package>
 #include <Plasma/Wallpaper>
 #include <Plasma/WindowEffects>
+#include <Plasma/PushButton>
 using namespace Plasma;
 
 FullView::FullView(const QString &ff, const QString &loc, bool persistent, QWidget \
*parent) @@ -59,7 +60,8 @@ FullView::FullView(const QString &ff, const QString &loc, \
bool persistent, QWidg  m_view(0),
       m_applet(0),
       m_appletShotTimer(0),
-      m_persistentConfig(persistent)
+      m_persistentConfig(persistent),
+      m_closeButton(0)
 {
     new SalViewerAdaptor(this);
     QDBusConnection dbus = QDBusConnection::sessionBus();
@@ -99,7 +101,6 @@ FullView::FullView(const QString &ff, const QString &loc, bool \
persistent, QWidg  m_location = Plasma::LeftEdge;
     }
 
-
     setWindowFlags(Qt::FramelessWindowHint);
     setAttribute(Qt::WA_TranslucentBackground);
     setAutoFillBackground(false);
@@ -108,7 +109,6 @@ FullView::FullView(const QString &ff, const QString &loc, bool \
persistent, QWidg  m_view->viewport()->setAttribute(Qt::WA_NoSystemBackground);
     Plasma::WindowEffects::overrideShadow(winId(), true);
 
-
     Plasma::ContainmentActionsPluginsConfig containmentActionPlugins;
     containmentActionPlugins.addPlugin(Qt::NoModifier, Qt::RightButton, \
"contextmenu");  
@@ -118,6 +118,12 @@ FullView::FullView(const QString &ff, const QString &loc, bool \
                persistent, QWidg
     m_corona->setContainmentActionsDefaults(Plasma::Containment::PanelContainment, \
                containmentActionPlugins);
     m_corona->setContainmentActionsDefaults(Plasma::Containment::CustomPanelContainment, \
containmentActionPlugins);  
+    m_closeButton = new Plasma::PushButton();
+    m_closeButton->setIcon(KIcon("dialog-close"));
+    m_closeButton->setText("Close");
+    m_closeButton->setZValue(1);
+    m_corona->addItem(m_closeButton);
+
     m_view->setScene(m_corona);
     connect(m_corona, SIGNAL(sceneRectChanged(QRectF)), this, \
SLOT(sceneRectChanged(QRectF)));  \
m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -125,7 +131,7 @@ \
FullView::FullView(const QString &ff, const QString &loc, bool persistent, QWidg  \
m_view->setAlignment(Qt::AlignLeft | Qt::AlignTop);  }
 
-void FullView::focusOutEvent ( QFocusEvent* event )
+void FullView::focusOutEvent(QFocusEvent* event)
 {
     kDebug() << "FOCUS OUT!!";
 //    hide();
@@ -135,6 +141,7 @@ FullView::~FullView()
 {
     kDebug() << "DTOR HIT";
 //    storeCurrentApplet();
+    delete m_closeButton;
 }
 
 void FullView::showPopup(int screen)
diff --git a/plasma/netbook/containments/sal/shell/fullview.h \
b/plasma/netbook/containments/sal/shell/fullview.h index 5c10654..c52f5d9 100644
--- a/plasma/netbook/containments/sal/shell/fullview.h
+++ b/plasma/netbook/containments/sal/shell/fullview.h
@@ -39,6 +39,7 @@ class QTimer;
 namespace Plasma
 {
     class AccessAppletJob;
+class PushButton;
 }
 
 class FullView : public KMainWindow
@@ -89,6 +90,7 @@ private:
     // passed through cli by default, config files
     // are non-persistent in plasmoidviewer.
     bool m_persistentConfig;
+    Plasma::PushButton *m_closeButton;
 };
 
 #endif


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

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