[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: hide when escape is pre
From: Shaun Reich <shaun.reich () kdemail ! net>
Date: 2012-03-20 15:29:45
Message-ID: 20120320152945.5ECD5A60A9 () git ! kde ! org
[Download RAW message or body]
Git commit 9bf844c945ba1374cd425ee2046e06019a7582a7 by Shaun Reich.
Committed on 20/03/2012 at 16:29.
Pushed by sreich into branch 'plasma/sreich/sal-qml'.
hide when escape is pressed, for salviewer
M +10 -0 plasma/netbook/containments/sal/shell/fullview.cpp
M +2 -1 plasma/netbook/containments/sal/shell/fullview.h
http://commits.kde.org/kde-workspace/9bf844c945ba1374cd425ee2046e06019a7582a7
diff --git a/plasma/netbook/containments/sal/shell/fullview.cpp \
b/plasma/netbook/containments/sal/shell/fullview.cpp index c5fb378..bb15fa9 100644
--- a/plasma/netbook/containments/sal/shell/fullview.cpp
+++ b/plasma/netbook/containments/sal/shell/fullview.cpp
@@ -122,6 +122,16 @@ FullView::~FullView()
storeCurrentApplet();
}
+void FullView::keyPressEvent (QKeyEvent *event)
+{
+ if (event->key() == Qt::Key_Escape) {
+ hide();
+ event->accept();
+ }
+
+ QGraphicsView::keyPressEvent(event);
+}
+
void FullView::addApplet(const QString &name, const QString &containment,
const QString& wallpaper, const QVariantList &args)
{
diff --git a/plasma/netbook/containments/sal/shell/fullview.h \
b/plasma/netbook/containments/sal/shell/fullview.h index 90963af..55e76a3 100644
--- a/plasma/netbook/containments/sal/shell/fullview.h
+++ b/plasma/netbook/containments/sal/shell/fullview.h
@@ -53,7 +53,8 @@ public:
protected:
void showEvent(QShowEvent *event);
- virtual void focusOutEvent ( QFocusEvent* event );
+ virtual void focusOutEvent(QFocusEvent *event);
+ virtual void keyPressEvent(QKeyEvent *event);
private Q_SLOTS:
void appletTransformedItself();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic