Merge lp:~agateau/unity-2d/add-launcher-maximum-width-property into lp:unity-2d/3.0

Proposed by Aurélien Gâteau
Status: Merged
Approved by: Aurélien Gâteau
Approved revision: 452
Merged at revision: 457
Proposed branch: lp:~agateau/unity-2d/add-launcher-maximum-width-property
Merge into: lp:unity-2d/3.0
Diff against target: 52 lines (+16/-0)
3 files modified
launcher/app/launcher.xml (+4/-0)
launcher/app/launcherdbus.cpp (+9/-0)
launcher/app/launcherdbus.h (+3/-0)
To merge this branch: bzr merge lp:~agateau/unity-2d/add-launcher-maximum-width-property
Reviewer Review Type Date Requested Status
Aurélien Gâteau (community) Approve
Ugo Riboni Pending
Review via email: mp+53268@code.launchpad.net

Commit message

[launcher] Add the MaximumWidth property to the launcher.

This can then be used by the Dash and the Spread to position themselves so that they do not overlap with the launcher.

Description of the change

Add the MaximumWidth property to the launcher.

This can then be used by the Dash and the Spread to position themselves so that they do not overlap with the launcher.

To post a comment you must log in.
452. By Aurélien Gâteau

Merged from trunk

Revision history for this message
Ugo Riboni (uriboni) wrote :

Can you please add a comment where you return width() saying that due to the fact we set maximumWidth somewhere else the value returned is going to be always the maximum width regardless of the current width of the launcher ?

I think it will help to clarify.

Other than that it's good and works fine.

Please set it to Approved yourself when you have added the comment. Thank you.

Revision history for this message
Aurélien Gâteau (agateau) wrote :

Makes sense. Fixed, pushed and approved.

review: Approve
453. By Aurélien Gâteau

Document why we can use width() to get the maximum width

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/app/launcher.xml'
2--- launcher/app/launcher.xml 2011-03-14 13:37:17 +0000
3+++ launcher/app/launcher.xml 2011-03-15 17:06:18 +0000
4@@ -31,6 +31,10 @@
5 hide.
6 ]]></dox:d>
7 </method>
8+
9+ <property name="MaximumWidth" type="i" access="read">
10+ <dox:d>The width of the launcher when it is fully visible.</dox:d>
11+ </property>
12 </interface>
13 </node>
14
15
16=== modified file 'launcher/app/launcherdbus.cpp'
17--- launcher/app/launcherdbus.cpp 2011-03-14 14:06:09 +0000
18+++ launcher/app/launcherdbus.cpp 2011-03-15 17:06:18 +0000
19@@ -77,3 +77,12 @@
20 UQ_RETURN_IF_FAIL(calledFromDBus());
21 m_visibilityController->endForceVisible(message().service());
22 }
23+
24+int
25+LauncherDBus::maximumWidth() const
26+{
27+ // The width of the view is set with setFixedWidth(), so asking for the
28+ // width() this way returns the maximum width without having to duplicate
29+ // the value.
30+ return m_view->window()->width();
31+}
32
33=== modified file 'launcher/app/launcherdbus.h'
34--- launcher/app/launcherdbus.h 2011-03-14 14:06:09 +0000
35+++ launcher/app/launcherdbus.h 2011-03-15 17:06:18 +0000
36@@ -35,6 +35,7 @@
37 class LauncherDBus : public QObject, protected QDBusContext
38 {
39 Q_OBJECT
40+ Q_PROPERTY(int MaximumWidth READ maximumWidth)
41
42 public:
43 LauncherDBus(VisibilityController* visibilityController, LauncherView* view, QObject* parent=0);
44@@ -50,6 +51,8 @@
45 private:
46 VisibilityController* m_visibilityController;
47 LauncherView* m_view;
48+
49+ int maximumWidth() const;
50 };
51
52 #endif // LauncherDBus_H

Subscribers

People subscribed via source and target branches