Merge lp:~aacid/unity-2d/unity-2d_UpdateShellPositionImprovements into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 944
Merged at revision: 951
Proposed branch: lp:~aacid/unity-2d/unity-2d_UpdateShellPositionImprovements
Merge into: lp:unity-2d
Diff against target: 47 lines (+18/-16)
1 file modified
shell/app/shelldeclarativeview.cpp (+18/-16)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d_UpdateShellPositionImprovements
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Review via email: mp+95403@code.launchpad.net

Description of the change

Small improvement for ShellDeclarativeView::updateShellPosition

To post a comment you must log in.
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
1=== modified file 'shell/app/shelldeclarativeview.cpp'
2--- shell/app/shelldeclarativeview.cpp 2012-02-28 12:00:14 +0000
3+++ shell/app/shelldeclarativeview.cpp 2012-03-01 16:31:18 +0000
4@@ -115,25 +115,27 @@
5 const QRect availableGeometry = m_screenInfo->availableGeometry();
6 QPoint posToMove = availableGeometry.topLeft();
7 if (qApp->isRightToLeft()) {
8- posToMove.setX(availableGeometry.width() - width());
9+ posToMove.rx() += (availableGeometry.width() - width());
10 }
11
12- QList<StrutManager *> strutManagers = rootObject()->findChildren<StrutManager*>();
13- Q_FOREACH(StrutManager *strutManager, strutManagers) {
14- if (strutManager->enabled()) {
15- // Do not push ourselves
16- switch (strutManager->edge()) {
17- case Unity2dPanel::TopEdge:
18- posToMove.ry() -= strutManager->realHeight();
19- break;
20+ if (rootObject() != NULL) {
21+ QList<StrutManager *> strutManagers = rootObject()->findChildren<StrutManager*>();
22+ Q_FOREACH(StrutManager *strutManager, strutManagers) {
23+ if (strutManager->enabled()) {
24+ // Do not push ourselves
25+ switch (strutManager->edge()) {
26+ case Unity2dPanel::TopEdge:
27+ posToMove.ry() -= strutManager->realHeight();
28+ break;
29
30- case Unity2dPanel::LeftEdge:
31- if (qApp->isLeftToRight()) {
32- posToMove.rx() -= strutManager->realWidth();
33- } else {
34- posToMove.rx() += strutManager->realWidth();
35- }
36- break;
37+ case Unity2dPanel::LeftEdge:
38+ if (qApp->isLeftToRight()) {
39+ posToMove.rx() -= strutManager->realWidth();
40+ } else {
41+ posToMove.rx() += strutManager->realWidth();
42+ }
43+ break;
44+ }
45 }
46 }
47 }

Subscribers

People subscribed via source and target branches