[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: Clicking the sallauncher now
From: Aurélien Gâteau <agateau () kde ! org>
Date: 2012-05-03 13:53:00
Message-ID: 20120503135300.9C01BA60C4 () git ! kde ! org
[Download RAW message or body]
Git commit e309c5048cf336db440877809a52aa29e59eccf6 by Aurélien Gâteau.
Committed on 03/05/2012 at 11:26.
Pushed by gateau into branch 'plasma/sreich/sal-qml'.
Clicking the sallauncher now toggles salviewer on and off
M +1 -1 plasma/netbook/containments/sal/applet/sallauncher.cpp
M +14 -9 plasma/netbook/containments/sal/shell/fullview.cpp
M +1 -1 plasma/netbook/containments/sal/shell/fullview.h
M +1 -1 plasma/netbook/containments/sal/shell/org.kde.salviewer.xml
http://commits.kde.org/kde-workspace/e309c5048cf336db440877809a52aa29e59eccf6
diff --git a/plasma/netbook/containments/sal/applet/sallauncher.cpp \
b/plasma/netbook/containments/sal/applet/sallauncher.cpp index 7b75bd0..7cc788f \
100644
--- a/plasma/netbook/containments/sal/applet/sallauncher.cpp
+++ b/plasma/netbook/containments/sal/applet/sallauncher.cpp
@@ -82,7 +82,7 @@ void SalLauncher::iconClicked()
QDBusInterface interface("org.kde.salViewer", "/SalViewer", "org.kde.salViewer", \
bus);
- interface.asyncCall("showPopup", containment()->screen());
+ interface.asyncCall("toggle", containment()->screen());
}
#include "sallauncher.moc"
diff --git a/plasma/netbook/containments/sal/shell/fullview.cpp \
b/plasma/netbook/containments/sal/shell/fullview.cpp index e046540..0d97d7e 100644
--- a/plasma/netbook/containments/sal/shell/fullview.cpp
+++ b/plasma/netbook/containments/sal/shell/fullview.cpp
@@ -130,19 +130,24 @@ void FullView::showEvent(QShowEvent *event)
}
-void FullView::showPopup(int screen)
+void FullView::toggle(int screen)
{
- kDebug() << "POPUP REQUESTED";
- KWindowSystem::setState( winId(), NET::SkipTaskbar | NET::SkipPager | \
NET::KeepAbove );
- KWindowSystem::forceActiveWindow(winId());
+ if (isVisible()) {
+ kDebug() << "HIDING POPUP";
+ hide();
+ } else {
+ kDebug() << "SHOWING POPUP";
+ KWindowSystem::setState( winId(), NET::SkipTaskbar | NET::SkipPager | \
NET::KeepAbove ); + KWindowSystem::forceActiveWindow(winId());
- QDesktopWidget w;
- const QRect rect = w.availableGeometry(screen);
+ QDesktopWidget w;
+ const QRect rect = w.availableGeometry(screen);
- kDebug() << "Rect, w: " << rect.width() << " h: " << rect.height();
+ kDebug() << "Rect, w: " << rect.width() << " h: " << rect.height();
- setGeometry(rect);
- show();
+ setGeometry(rect);
+ show();
+ }
}
void FullView::keyPressEvent(QKeyEvent *event)
diff --git a/plasma/netbook/containments/sal/shell/fullview.h \
b/plasma/netbook/containments/sal/shell/fullview.h index 77dc902..b056f63 100644
--- a/plasma/netbook/containments/sal/shell/fullview.h
+++ b/plasma/netbook/containments/sal/shell/fullview.h
@@ -52,7 +52,7 @@ public:
~FullView();
public Q_SLOTS:
- void showPopup(int screen);
+ void toggle(int screen);
void setContainment(Plasma::Containment *containment);
void updateGeometry();
diff --git a/plasma/netbook/containments/sal/shell/org.kde.salviewer.xml \
b/plasma/netbook/containments/sal/shell/org.kde.salviewer.xml index 8080cc1..801e176 \
100644
--- a/plasma/netbook/containments/sal/shell/org.kde.salviewer.xml
+++ b/plasma/netbook/containments/sal/shell/org.kde.salviewer.xml
@@ -1,7 +1,7 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" \
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node>
<interface name="org.kde.salViewer">
- <method name="showPopup">
+ <method name="toggle">
<arg name="screen" type="i" direction="in"/>
</method>
</interface>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic