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

Proposed by Andrea Cimitan
Status: Merged
Approved by: Michał Sawicz
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 Approve
PS Jenkins bot continuous-integration Approve
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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/Ubuntu/Components/Panel.qml'
--- modules/Ubuntu/Components/Panel.qml 2013-09-09 19:11:39 +0000
+++ modules/Ubuntu/Components/Panel.qml 2013-09-20 08:59:16 +0000
@@ -534,6 +534,8 @@
534 //position will always be in the range 0..size, where position==0 means spread, position==size means hidden.534 //position will always be in the range 0..size, where position==0 means spread, position==size means hidden.
535 property real position: panel.opened ? 0 : size535 property real position: panel.opened ? 0 : size
536536
537 onPositionChanged: bottomBarVisibilityCommunicator.position = size - position
538
537 y: internal.align === Qt.AlignTop ? -position : internal.align === Qt.AlignBottom ? position : 0539 y: internal.align === Qt.AlignTop ? -position : internal.align === Qt.AlignBottom ? position : 0
538 x: internal.align === Qt.AlignLeft ? -position : internal.align === Qt.AlignRight ? position : 0540 x: internal.align === Qt.AlignLeft ? -position : internal.align === Qt.AlignRight ? position : 0
539 }541 }
540542
=== modified file 'modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp'
--- modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp 2013-02-27 12:45:08 +0000
+++ modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.cpp 2013-09-20 08:59:16 +0000
@@ -35,7 +35,8 @@
3535
36BottomBarVisibilityCommunicator::BottomBarVisibilityCommunicator()36BottomBarVisibilityCommunicator::BottomBarVisibilityCommunicator()
37 : m_shellDbusIface(NULL),37 : m_shellDbusIface(NULL),
38 m_forceHidden(false)38 m_forceHidden(false),
39 m_position(0)
39{40{
40 m_shellDbusIface = new QDBusInterface(DBUS_SERVICE, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_INTERFACE, QDBusConnection::sessionBus(), this);41 m_shellDbusIface = new QDBusInterface(DBUS_SERVICE, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_PATH, BOTTOM_BAR_VISIBILITY_COMMUNICATOR_DBUS_INTERFACE, QDBusConnection::sessionBus(), this);
41 if (m_shellDbusIface->isValid()) {42 if (m_shellDbusIface->isValid()) {
@@ -51,6 +52,20 @@
51 return m_forceHidden;52 return m_forceHidden;
52}53}
5354
55double BottomBarVisibilityCommunicator::position() const
56{
57 return m_position;
58}
59
60void BottomBarVisibilityCommunicator::setPosition(double position)
61{
62 if (position != m_position) {
63 m_position = position;
64 m_shellDbusIface->setProperty("position", position);
65 Q_EMIT positionChanged(position);
66 }
67}
68
54void BottomBarVisibilityCommunicator::onShellForceHiddenChanged(bool forceHidden)69void BottomBarVisibilityCommunicator::onShellForceHiddenChanged(bool forceHidden)
55{70{
56 if (forceHidden != m_forceHidden) {71 if (forceHidden != m_forceHidden) {
5772
=== modified file 'modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.h'
--- modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.h 2013-02-11 17:47:48 +0000
+++ modules/Ubuntu/Components/plugin/bottombarvisibilitycommunicator.h 2013-09-20 08:59:16 +0000
@@ -26,6 +26,7 @@
26{26{
27 Q_OBJECT27 Q_OBJECT
28 Q_PROPERTY(bool forceHidden READ forceHidden NOTIFY forceHiddenChanged)28 Q_PROPERTY(bool forceHidden READ forceHidden NOTIFY forceHiddenChanged)
29 Q_PROPERTY(double position READ position WRITE setPosition NOTIFY positionChanged)
2930
30public:31public:
31 static BottomBarVisibilityCommunicator& instance() {32 static BottomBarVisibilityCommunicator& instance() {
@@ -34,9 +35,12 @@
34 }35 }
3536
36 bool forceHidden() const;37 bool forceHidden() const;
38 double position() const;
39 void setPosition(double position);
3740
38Q_SIGNALS:41Q_SIGNALS:
39 void forceHiddenChanged(bool forceHidden);42 void forceHiddenChanged(bool forceHidden);
43 void positionChanged(double position);
4044
41private Q_SLOTS:45private Q_SLOTS:
42 void onShellForceHiddenChanged(bool forceHidden);46 void onShellForceHiddenChanged(bool forceHidden);
@@ -46,6 +50,8 @@
4650
47 QDBusInterface* m_shellDbusIface;51 QDBusInterface* m_shellDbusIface;
4852
53 double m_position;
54
49 // This is cached from dbus55 // This is cached from dbus
50 bool m_forceHidden;56 bool m_forceHidden;
51};57};

Subscribers

People subscribed via source and target branches

to status/vote changes: