Merge lp:~cimi/ubuntu-ui-toolkit/panel_export-position into lp:ubuntu-ui-toolkit

Proposed by Andrea Cimitan on 2013-09-20
Status: Merged
Approved by: Michał Sawicz on 2013-10-03
Approved revision: 752
Merged at revision: 782
Proposed branch: lp:~cimi/ubuntu-ui-toolkit/panel_export-position
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 81 lines (+24/-1)
3 files modified
modules/Ubuntu/Components/Panel.qml (+2/-0)
modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp (+16/-1)
modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.h (+6/-0)
To merge this branch: bzr merge lp:~cimi/ubuntu-ui-toolkit/panel_export-position
Reviewer Review Type Date Requested Status
Michał Sawicz 2013-09-20 Approve on 2013-10-03
PS Jenkins bot continuous-integration Approve on 2013-09-24
Review via email: mp+186727@code.launchpad.net

Commit message

Export a position value of the toolbar through dbus, setting the value of the dbus service created by the shell

Description of the change

The hud requires some extra info about the panel in order to apply some interactions.

To post a comment you must log in.
Michał Sawicz (saviq) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/Panel.qml'
2--- modules/Ubuntu/Components/Panel.qml 2013-09-09 19:11:39 +0000
3+++ modules/Ubuntu/Components/Panel.qml 2013-09-20 08:59:16 +0000
4@@ -534,6 +534,8 @@
5 //position will always be in the range 0..size, where position==0 means spread, position==size means hidden.
6 property real position: panel.opened ? 0 : size
7
8+ onPositionChanged: bottomBarVisibilityCommunicator.position = size - position
9+
10 y: internal.align === Qt.AlignTop ? -position : internal.align === Qt.AlignBottom ? position : 0
11 x: internal.align === Qt.AlignLeft ? -position : internal.align === Qt.AlignRight ? position : 0
12 }
13
14=== modified file 'modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp'
15--- modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp 2013-02-27 12:45:08 +0000
16+++ modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp 2013-09-20 08:59:16 +0000
17@@ -35,7 +35,8 @@
18
19 BottomBarVisibilityCommunicator::BottomBarVisibilityCommunicator()
20 : m_shellDbusIface(NULL),
21- m_forceHidden(false)
22+ m_forceHidden(false),
23+ m_position(0)
24 {
25 m_shellDbusIface = new QDBusInterface(DBUS_SERVICE, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_INTERFACE, QDBusConnection::sessionBus(), this);
26 if (m_shellDbusIface->isValid()) {
27@@ -51,6 +52,20 @@
28 return m_forceHidden;
29 }
30
31+double BottomBarVisibilityCommunicator::position() const
32+{
33+ return m_position;
34+}
35+
36+void BottomBarVisibilityCommunicator::setPosition(double position)
37+{
38+ if (position != m_position) {
39+ m_position = position;
40+ m_shellDbusIface->setProperty("position", position);
41+ Q_EMIT positionChanged(position);
42+ }
43+}
44+
45 void BottomBarVisibilityCommunicator::onShellForceHiddenChanged(bool forceHidden)
46 {
47 if (forceHidden != m_forceHidden) {
48
49=== modified file 'modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.h'
50--- modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.h 2013-02-11 17:47:48 +0000
51+++ modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.h 2013-09-20 08:59:16 +0000
52@@ -26,6 +26,7 @@
53 {
54 Q_OBJECT
55 Q_PROPERTY(bool forceHidden READ forceHidden NOTIFY forceHiddenChanged)
56+ Q_PROPERTY(double position READ position WRITE setPosition NOTIFY positionChanged)
57
58 public:
59 static BottomBarVisibilityCommunicator& instance() {
60@@ -34,9 +35,12 @@
61 }
62
63 bool forceHidden() const;
64+ double position() const;
65+ void setPosition(double position);
66
67 Q_SIGNALS:
68 void forceHiddenChanged(bool forceHidden);
69+ void positionChanged(double position);
70
71 private Q_SLOTS:
72 void onShellForceHiddenChanged(bool forceHidden);
73@@ -46,6 +50,8 @@
74
75 QDBusInterface* m_shellDbusIface;
76
77+ double m_position;
78+
79 // This is cached from dbus
80 bool m_forceHidden;
81 };

Subscribers

People subscribed via source and target branches

to status/vote changes: