Merge lp:~saviq/unity-2d/shell_revert-resizable-launcher into lp:~unity-2d-team/unity-2d/unity-2d-shell-shaped
- shell_revert-resizable-launcher
- Merge into unity-2d-shell-shaped
Proposed by
Michał Sawicz
Status: | Merged |
---|---|
Approved by: | Ugo Riboni |
Approved revision: | 916 |
Merged at revision: | 916 |
Proposed branch: | lp:~saviq/unity-2d/shell_revert-resizable-launcher |
Merge into: | lp:~unity-2d-team/unity-2d/unity-2d-shell-shaped |
Diff against target: |
506 lines (+51/-88) 13 files modified
data/com.canonical.Unity2d.gschema.xml (+0/-5) libunity-2d-private/src/launcherclient.cpp (+2/-0) libunity-2d-private/src/launcherclient.h (+1/-0) libunity-2d-private/src/screeninfo.cpp (+2/-11) libunity-2d-private/src/screeninfo.h (+0/-1) libunity-2d-private/src/unity2dpanel.cpp (+8/-26) libunity-2d-private/src/unity2dpanel.h (+1/-4) panel/app/panelmanager.cpp (+1/-1) panel/applets/appname/appnameapplet.cpp (+2/-3) shell/Shell.qml (+1/-1) shell/launcher/Launcher.qml (+4/-2) shell/launcher/LauncherItem.qml (+25/-30) shell/launcher/LauncherList.qml (+4/-4) |
To merge this branch: | bzr merge lp:~saviq/unity-2d/shell_revert-resizable-launcher |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ugo Riboni | Pending | ||
Review via email: mp+88744@code.launchpad.net |
Commit message
[shell] revert resizable launcher
The resizable launcher code needs to be revisited at a later time.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'data/com.canonical.Unity2d.gschema.xml' | |||
2 | --- data/com.canonical.Unity2d.gschema.xml 2011-12-14 13:36:26 +0000 | |||
3 | +++ data/com.canonical.Unity2d.gschema.xml 2012-01-16 18:02:25 +0000 | |||
4 | @@ -24,11 +24,6 @@ | |||
5 | 24 | 2: intellihide; same as auto hide but the launcher will disappear if a window is placed on top of it | 24 | 2: intellihide; same as auto hide but the launcher will disappear if a window is placed on top of it |
6 | 25 | </description> | 25 | </description> |
7 | 26 | </key> | 26 | </key> |
8 | 27 | <key name="thickness" type="i"> | ||
9 | 28 | <default>66</default> | ||
10 | 29 | <summary>Thickness of the launcher</summary> | ||
11 | 30 | <description>Size of the small side (typically the horizontal side) of the launcher</description> | ||
12 | 31 | </key> | ||
13 | 32 | </schema> | 27 | </schema> |
14 | 33 | <schema path="/com/canonical/unity-2d/panel/" id="com.canonical.Unity2d.Panel" gettext-domain="unity-2d"> | 28 | <schema path="/com/canonical/unity-2d/panel/" id="com.canonical.Unity2d.Panel" gettext-domain="unity-2d"> |
15 | 34 | <key type="as" name="applets"> | 29 | <key type="as" name="applets"> |
16 | 35 | 30 | ||
17 | === modified file 'libunity-2d-private/src/launcherclient.cpp' | |||
18 | --- libunity-2d-private/src/launcherclient.cpp 2012-01-10 10:42:46 +0000 | |||
19 | +++ libunity-2d-private/src/launcherclient.cpp 2012-01-16 18:02:25 +0000 | |||
20 | @@ -21,4 +21,6 @@ | |||
21 | 21 | // Self | 21 | // Self |
22 | 22 | #include "launcherclient.h" | 22 | #include "launcherclient.h" |
23 | 23 | 23 | ||
24 | 24 | const int LauncherClient::MaximumWidth = 65; | ||
25 | 25 | |||
26 | 24 | #include "launcherclient.moc" | 26 | #include "launcherclient.moc" |
27 | 25 | 27 | ||
28 | === modified file 'libunity-2d-private/src/launcherclient.h' | |||
29 | --- libunity-2d-private/src/launcherclient.h 2011-12-14 13:45:43 +0000 | |||
30 | +++ libunity-2d-private/src/launcherclient.h 2012-01-16 18:02:25 +0000 | |||
31 | @@ -32,6 +32,7 @@ | |||
32 | 32 | class LauncherClient | 32 | class LauncherClient |
33 | 33 | { | 33 | { |
34 | 34 | public: | 34 | public: |
35 | 35 | static const int MaximumWidth; | ||
36 | 35 | }; | 36 | }; |
37 | 36 | 37 | ||
38 | 37 | #endif /* LAUNCHERCLIENT_H */ | 38 | #endif /* LAUNCHERCLIENT_H */ |
39 | 38 | 39 | ||
40 | === modified file 'libunity-2d-private/src/screeninfo.cpp' | |||
41 | --- libunity-2d-private/src/screeninfo.cpp 2012-01-09 18:08:01 +0000 | |||
42 | +++ libunity-2d-private/src/screeninfo.cpp 2012-01-16 18:02:25 +0000 | |||
43 | @@ -14,7 +14,6 @@ | |||
44 | 14 | #include <QX11Info> | 14 | #include <QX11Info> |
45 | 15 | #include <QApplication> | 15 | #include <QApplication> |
46 | 16 | #include <QDesktopWidget> | 16 | #include <QDesktopWidget> |
47 | 17 | #include <QVariant> | ||
48 | 18 | 17 | ||
49 | 19 | ScreenInfo::ScreenInfo(QObject *parent) : | 18 | ScreenInfo::ScreenInfo(QObject *parent) : |
50 | 20 | QObject(parent), | 19 | QObject(parent), |
51 | @@ -30,8 +29,6 @@ | |||
52 | 30 | SLOT(updateGeometry(int))); | 29 | SLOT(updateGeometry(int))); |
53 | 31 | connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), | 30 | connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), |
54 | 32 | SLOT(updateAvailableGeometry(int))); | 31 | SLOT(updateAvailableGeometry(int))); |
55 | 33 | connect(&launcher2dConfiguration(), SIGNAL(thicknessChanged(int)), | ||
56 | 34 | SLOT(onLauncherThicknessChanged())); | ||
57 | 35 | } | 32 | } |
58 | 36 | 33 | ||
59 | 37 | 34 | ||
60 | @@ -79,11 +76,10 @@ | |||
61 | 79 | QRect screenRect = QApplication::desktop()->screenGeometry(screen); | 76 | QRect screenRect = QApplication::desktop()->screenGeometry(screen); |
62 | 80 | QRect availableRect = QApplication::desktop()->availableGeometry(screen); | 77 | QRect availableRect = QApplication::desktop()->availableGeometry(screen); |
63 | 81 | 78 | ||
64 | 82 | int launcherThickness = launcher2dConfiguration().property("thickness").toInt(); | ||
65 | 83 | QRect availableGeometry( | 79 | QRect availableGeometry( |
67 | 84 | launcherThickness, | 80 | LauncherClient::MaximumWidth, |
68 | 85 | availableRect.top(), | 81 | availableRect.top(), |
70 | 86 | screenRect.width() - launcherThickness, | 82 | screenRect.width() - LauncherClient::MaximumWidth, |
71 | 87 | availableRect.height() | 83 | availableRect.height() |
72 | 88 | ); | 84 | ); |
73 | 89 | if (QApplication::isRightToLeft()) { | 85 | if (QApplication::isRightToLeft()) { |
74 | @@ -112,11 +108,6 @@ | |||
75 | 112 | } | 108 | } |
76 | 113 | } | 109 | } |
77 | 114 | 110 | ||
78 | 115 | void ScreenInfo::onLauncherThicknessChanged() | ||
79 | 116 | { | ||
80 | 117 | Q_EMIT panelsFreeGeometryChanged(panelsFreeGeometry()); | ||
81 | 118 | } | ||
82 | 119 | |||
83 | 120 | bool ScreenInfo::isCompositingManagerRunning() const | 111 | bool ScreenInfo::isCompositingManagerRunning() const |
84 | 121 | { | 112 | { |
85 | 122 | return QX11Info::isCompositingManagerRunning(); | 113 | return QX11Info::isCompositingManagerRunning(); |
86 | 123 | 114 | ||
87 | === modified file 'libunity-2d-private/src/screeninfo.h' | |||
88 | --- libunity-2d-private/src/screeninfo.h 2012-01-09 18:08:01 +0000 | |||
89 | +++ libunity-2d-private/src/screeninfo.h 2012-01-16 18:02:25 +0000 | |||
90 | @@ -54,7 +54,6 @@ | |||
91 | 54 | private Q_SLOTS: | 54 | private Q_SLOTS: |
92 | 55 | void updateGeometry(int screen); | 55 | void updateGeometry(int screen); |
93 | 56 | void updateAvailableGeometry(int screen); | 56 | void updateAvailableGeometry(int screen); |
94 | 57 | void onLauncherThicknessChanged(); | ||
95 | 58 | 57 | ||
96 | 59 | private: | 58 | private: |
97 | 60 | WorkspacesInfo m_workspacesInfo; | 59 | WorkspacesInfo m_workspacesInfo; |
98 | 61 | 60 | ||
99 | === modified file 'libunity-2d-private/src/unity2dpanel.cpp' | |||
100 | --- libunity-2d-private/src/unity2dpanel.cpp 2011-12-14 13:34:52 +0000 | |||
101 | +++ libunity-2d-private/src/unity2dpanel.cpp 2012-01-16 18:02:25 +0000 | |||
102 | @@ -49,7 +49,6 @@ | |||
103 | 49 | bool m_useStrut; | 49 | bool m_useStrut; |
104 | 50 | int m_delta; | 50 | int m_delta; |
105 | 51 | bool m_manualSliding; | 51 | bool m_manualSliding; |
106 | 52 | int m_thickness; | ||
107 | 53 | 52 | ||
108 | 54 | void setStrut(ulong* struts) | 53 | void setStrut(ulong* struts) |
109 | 55 | { | 54 | { |
110 | @@ -105,15 +104,15 @@ | |||
111 | 105 | switch (m_edge) { | 104 | switch (m_edge) { |
112 | 106 | case Unity2dPanel::LeftEdge: | 105 | case Unity2dPanel::LeftEdge: |
113 | 107 | if (QApplication::isLeftToRight()) { | 106 | if (QApplication::isLeftToRight()) { |
115 | 108 | rect = QRect(screen.left(), available.top(), m_thickness, available.height()); | 107 | rect = QRect(screen.left(), available.top(), q->width(), available.height()); |
116 | 109 | rect.moveLeft(m_delta); | 108 | rect.moveLeft(m_delta); |
117 | 110 | } else { | 109 | } else { |
119 | 111 | rect = QRect(screen.right() - m_thickness, available.top(), m_thickness, available.height()); | 110 | rect = QRect(screen.right() - q->width(), available.top(), q->width(), available.height()); |
120 | 112 | rect.moveRight(screen.right() - m_delta); | 111 | rect.moveRight(screen.right() - m_delta); |
121 | 113 | } | 112 | } |
122 | 114 | break; | 113 | break; |
123 | 115 | case Unity2dPanel::TopEdge: | 114 | case Unity2dPanel::TopEdge: |
125 | 116 | rect = QRect(screen.left(), screen.top(), screen.width(), m_thickness); | 115 | rect = QRect(screen.left(), screen.top(), screen.width(), q->height()); |
126 | 117 | rect.moveTop(m_delta); | 116 | rect.moveTop(m_delta); |
127 | 118 | break; | 117 | break; |
128 | 119 | } | 118 | } |
129 | @@ -158,7 +157,6 @@ | |||
130 | 158 | d->m_layout = new QHBoxLayout(this); | 157 | d->m_layout = new QHBoxLayout(this); |
131 | 159 | d->m_layout->setMargin(0); | 158 | d->m_layout->setMargin(0); |
132 | 160 | d->m_layout->setSpacing(0); | 159 | d->m_layout->setSpacing(0); |
133 | 161 | d->m_thickness = 0; | ||
134 | 162 | 160 | ||
135 | 163 | d->m_slideInAnimation = new QPropertyAnimation(this); | 161 | d->m_slideInAnimation = new QPropertyAnimation(this); |
136 | 164 | d->m_slideInAnimation->setTargetObject(this); | 162 | d->m_slideInAnimation->setTargetObject(this); |
137 | @@ -170,7 +168,7 @@ | |||
138 | 170 | d->m_slideOutAnimation->setTargetObject(this); | 168 | d->m_slideOutAnimation->setTargetObject(this); |
139 | 171 | d->m_slideOutAnimation->setPropertyName("delta"); | 169 | d->m_slideOutAnimation->setPropertyName("delta"); |
140 | 172 | d->m_slideOutAnimation->setDuration(SLIDE_DURATION); | 170 | d->m_slideOutAnimation->setDuration(SLIDE_DURATION); |
142 | 173 | d->m_slideOutAnimation->setEndValue(-thickness()); | 171 | d->m_slideOutAnimation->setEndValue(-panelSize()); |
143 | 174 | 172 | ||
144 | 175 | setAttribute(Qt::WA_X11NetWmWindowTypeDock); | 173 | setAttribute(Qt::WA_X11NetWmWindowTypeDock); |
145 | 176 | setAttribute(Qt::WA_Hover); | 174 | setAttribute(Qt::WA_Hover); |
146 | @@ -219,13 +217,13 @@ | |||
147 | 219 | { | 217 | { |
148 | 220 | QWidget::showEvent(event); | 218 | QWidget::showEvent(event); |
149 | 221 | d->updateEdge(); | 219 | d->updateEdge(); |
151 | 222 | d->m_slideOutAnimation->setEndValue(-thickness()); | 220 | d->m_slideOutAnimation->setEndValue(-panelSize()); |
152 | 223 | } | 221 | } |
153 | 224 | 222 | ||
154 | 225 | void Unity2dPanel::resizeEvent(QResizeEvent* event) | 223 | void Unity2dPanel::resizeEvent(QResizeEvent* event) |
155 | 226 | { | 224 | { |
156 | 227 | QWidget::resizeEvent(event); | 225 | QWidget::resizeEvent(event); |
158 | 228 | d->m_slideOutAnimation->setEndValue(-thickness()); | 226 | d->m_slideOutAnimation->setEndValue(-panelSize()); |
159 | 229 | } | 227 | } |
160 | 230 | 228 | ||
161 | 231 | void Unity2dPanel::slotWorkAreaResized(int screen) | 229 | void Unity2dPanel::slotWorkAreaResized(int screen) |
162 | @@ -279,34 +277,18 @@ | |||
163 | 279 | void Unity2dPanel::setDelta(int delta) | 277 | void Unity2dPanel::setDelta(int delta) |
164 | 280 | { | 278 | { |
165 | 281 | /* Clamp delta to be between 0 and minus its size */ | 279 | /* Clamp delta to be between 0 and minus its size */ |
167 | 282 | int minDelta = -thickness(); | 280 | int minDelta = -panelSize(); |
168 | 283 | int maxDelta = 0; | 281 | int maxDelta = 0; |
169 | 284 | 282 | ||
170 | 285 | d->m_delta = qMax(qMin(delta, maxDelta), minDelta); | 283 | d->m_delta = qMax(qMin(delta, maxDelta), minDelta); |
171 | 286 | d->updateGeometry(); | 284 | d->updateGeometry(); |
172 | 287 | } | 285 | } |
173 | 288 | 286 | ||
175 | 289 | int Unity2dPanel::thickness() const | 287 | int Unity2dPanel::panelSize() const |
176 | 290 | { | 288 | { |
177 | 291 | return (d->m_edge == Unity2dPanel::TopEdge) ? height() : width(); | 289 | return (d->m_edge == Unity2dPanel::TopEdge) ? height() : width(); |
178 | 292 | } | 290 | } |
179 | 293 | 291 | ||
180 | 294 | void Unity2dPanel::setThickness(int thickness) | ||
181 | 295 | { | ||
182 | 296 | if (thickness == d->m_thickness) { | ||
183 | 297 | return; | ||
184 | 298 | } | ||
185 | 299 | |||
186 | 300 | d->m_thickness = thickness; | ||
187 | 301 | |||
188 | 302 | /* Update variables that depend on thickness' value */ | ||
189 | 303 | setDelta(d->m_delta); | ||
190 | 304 | d->m_slideOutAnimation->setEndValue(-thickness); | ||
191 | 305 | d->updateGeometry(); | ||
192 | 306 | |||
193 | 307 | Q_EMIT thicknessChanged(thickness); | ||
194 | 308 | } | ||
195 | 309 | |||
196 | 310 | void Unity2dPanel::slideIn() | 292 | void Unity2dPanel::slideIn() |
197 | 311 | { | 293 | { |
198 | 312 | d->m_slideOutAnimation->stop(); | 294 | d->m_slideOutAnimation->stop(); |
199 | 313 | 295 | ||
200 | === modified file 'libunity-2d-private/src/unity2dpanel.h' | |||
201 | --- libunity-2d-private/src/unity2dpanel.h 2011-12-14 13:34:52 +0000 | |||
202 | +++ libunity-2d-private/src/unity2dpanel.h 2012-01-16 18:02:25 +0000 | |||
203 | @@ -45,7 +45,6 @@ | |||
204 | 45 | */ | 45 | */ |
205 | 46 | Q_PROPERTY(int manualSliding READ manualSliding WRITE setManualSliding NOTIFY manualSlidingChanged) | 46 | Q_PROPERTY(int manualSliding READ manualSliding WRITE setManualSliding NOTIFY manualSlidingChanged) |
206 | 47 | Q_PROPERTY(bool useStrut READ useStrut WRITE setUseStrut NOTIFY useStrutChanged) | 47 | Q_PROPERTY(bool useStrut READ useStrut WRITE setUseStrut NOTIFY useStrutChanged) |
207 | 48 | Q_PROPERTY(int thickness READ thickness WRITE setThickness NOTIFY thicknessChanged) | ||
208 | 49 | 48 | ||
209 | 50 | public: | 49 | public: |
210 | 51 | enum Edge { | 50 | enum Edge { |
211 | @@ -77,8 +76,7 @@ | |||
212 | 77 | int delta() const; | 76 | int delta() const; |
213 | 78 | void setDelta(int); | 77 | void setDelta(int); |
214 | 79 | 78 | ||
217 | 80 | int thickness() const; | 79 | int panelSize() const; |
216 | 81 | void setThickness(int); | ||
218 | 82 | 80 | ||
219 | 83 | bool manualSliding() const; | 81 | bool manualSliding() const; |
220 | 84 | void setManualSliding(bool); | 82 | void setManualSliding(bool); |
221 | @@ -92,7 +90,6 @@ | |||
222 | 92 | Q_SIGNALS: | 90 | Q_SIGNALS: |
223 | 93 | void manualSlidingChanged(bool); | 91 | void manualSlidingChanged(bool); |
224 | 94 | void useStrutChanged(bool); | 92 | void useStrutChanged(bool); |
225 | 95 | void thicknessChanged(int); | ||
226 | 96 | 93 | ||
227 | 97 | protected: | 94 | protected: |
228 | 98 | virtual void showEvent(QShowEvent*); | 95 | virtual void showEvent(QShowEvent*); |
229 | 99 | 96 | ||
230 | === modified file 'panel/app/panelmanager.cpp' | |||
231 | --- panel/app/panelmanager.cpp 2011-12-14 13:34:52 +0000 | |||
232 | +++ panel/app/panelmanager.cpp 2012-01-16 18:02:25 +0000 | |||
233 | @@ -141,7 +141,7 @@ | |||
234 | 141 | Unity2dPanel* panel = new Unity2dPanel; | 141 | Unity2dPanel* panel = new Unity2dPanel; |
235 | 142 | panel->setAccessibleName("Top Panel"); | 142 | panel->setAccessibleName("Top Panel"); |
236 | 143 | panel->setEdge(Unity2dPanel::TopEdge); | 143 | panel->setEdge(Unity2dPanel::TopEdge); |
238 | 144 | panel->setThickness(24); | 144 | panel->setFixedHeight(24); |
239 | 145 | 145 | ||
240 | 146 | QPoint p; | 146 | QPoint p; |
241 | 147 | if (QApplication::isRightToLeft()) { | 147 | if (QApplication::isRightToLeft()) { |
242 | 148 | 148 | ||
243 | === modified file 'panel/applets/appname/appnameapplet.cpp' | |||
244 | --- panel/applets/appname/appnameapplet.cpp 2011-12-14 13:36:26 +0000 | |||
245 | +++ panel/applets/appname/appnameapplet.cpp 2012-01-16 18:02:25 +0000 | |||
246 | @@ -55,7 +55,6 @@ | |||
247 | 55 | #include <QPoint> | 55 | #include <QPoint> |
248 | 56 | 56 | ||
249 | 57 | static const int APPNAME_LABEL_LEFT_MARGIN = 6; | 57 | static const int APPNAME_LABEL_LEFT_MARGIN = 6; |
250 | 58 | static const int APPNAME_WINDOW_BUTTONS_WIDTH = 66; | ||
251 | 59 | 58 | ||
252 | 60 | class WindowButton : public QAbstractButton | 59 | class WindowButton : public QAbstractButton |
253 | 61 | { | 60 | { |
254 | @@ -183,7 +182,7 @@ | |||
255 | 183 | layout->addWidget(m_closeButton); | 182 | layout->addWidget(m_closeButton); |
256 | 184 | layout->addWidget(m_minimizeButton); | 183 | layout->addWidget(m_minimizeButton); |
257 | 185 | layout->addWidget(m_maximizeButton); | 184 | layout->addWidget(m_maximizeButton); |
259 | 186 | m_windowButtonWidget->setFixedWidth(APPNAME_WINDOW_BUTTONS_WIDTH); | 185 | m_windowButtonWidget->setFixedWidth(LauncherClient::MaximumWidth); |
260 | 187 | QObject::connect(m_closeButton, SIGNAL(clicked()), m_windowHelper, SLOT(close())); | 186 | QObject::connect(m_closeButton, SIGNAL(clicked()), m_windowHelper, SLOT(close())); |
261 | 188 | QObject::connect(m_minimizeButton, SIGNAL(clicked()), m_windowHelper, SLOT(minimize())); | 187 | QObject::connect(m_minimizeButton, SIGNAL(clicked()), m_windowHelper, SLOT(minimize())); |
262 | 189 | QObject::connect(m_maximizeButton, SIGNAL(clicked()), m_windowHelper, SLOT(toggleMaximize())); | 188 | QObject::connect(m_maximizeButton, SIGNAL(clicked()), m_windowHelper, SLOT(toggleMaximize())); |
263 | @@ -301,7 +300,7 @@ | |||
264 | 301 | 300 | ||
265 | 302 | // Define label width | 301 | // Define label width |
266 | 303 | if (!isMaximized && showMenu) { | 302 | if (!isMaximized && showMenu) { |
268 | 304 | d->m_label->setMaximumWidth(APPNAME_WINDOW_BUTTONS_WIDTH); | 303 | d->m_label->setMaximumWidth(LauncherClient::MaximumWidth); |
269 | 305 | } else { | 304 | } else { |
270 | 306 | d->m_label->setMaximumWidth(QWIDGETSIZE_MAX); | 305 | d->m_label->setMaximumWidth(QWIDGETSIZE_MAX); |
271 | 307 | } | 306 | } |
272 | 308 | 307 | ||
273 | === modified file 'shell/Shell.qml' | |||
274 | --- shell/Shell.qml 2012-01-13 11:58:28 +0000 | |||
275 | +++ shell/Shell.qml 2012-01-16 18:02:25 +0000 | |||
276 | @@ -31,7 +31,7 @@ | |||
277 | 31 | id: launcherLoader | 31 | id: launcherLoader |
278 | 32 | anchors.top: parent.top | 32 | anchors.top: parent.top |
279 | 33 | anchors.bottom: parent.bottom | 33 | anchors.bottom: parent.bottom |
281 | 34 | width: launcher2dConfiguration.thickness | 34 | width: 65 |
282 | 35 | x: visibilityController.shown ? 0 : -width | 35 | x: visibilityController.shown ? 0 : -width |
283 | 36 | 36 | ||
284 | 37 | KeyNavigation.right: dashLoader | 37 | KeyNavigation.right: dashLoader |
285 | 38 | 38 | ||
286 | === modified file 'shell/launcher/Launcher.qml' | |||
287 | --- shell/launcher/Launcher.qml 2012-01-10 16:41:53 +0000 | |||
288 | +++ shell/launcher/Launcher.qml 2012-01-16 18:02:25 +0000 | |||
289 | @@ -117,9 +117,10 @@ | |||
290 | 117 | } | 117 | } |
291 | 118 | 118 | ||
292 | 119 | anchors.top: parent.top | 119 | anchors.top: parent.top |
294 | 120 | anchors.bottom: shelf.top | 120 | anchors.bottomMargin: 0 |
295 | 121 | /* the distance from the top of the launcher and the dash tile is 6 instead of 7 */ | 121 | /* the distance from the top of the launcher and the dash tile is 6 instead of 7 */ |
296 | 122 | anchors.topMargin: -1 | 122 | anchors.topMargin: -1 |
297 | 123 | height: parent.height - shelf.height + ((selectionOutlineSize - tileSize)) - 4 | ||
298 | 123 | width: parent.width | 124 | width: parent.width |
299 | 124 | 125 | ||
300 | 125 | /* Ensure all delegates are cached in order to improve smoothness of | 126 | /* Ensure all delegates are cached in order to improve smoothness of |
301 | @@ -163,7 +164,8 @@ | |||
302 | 163 | objectName: "shelf" | 164 | objectName: "shelf" |
303 | 164 | 165 | ||
304 | 165 | anchors.bottom: parent.bottom | 166 | anchors.bottom: parent.bottom |
306 | 166 | anchors.bottomMargin: main.anchors.topMargin | 167 | anchors.bottomMargin: main.anchors.bottomMargin |
307 | 168 | anchors.topMargin: main.anchors.topMargin | ||
308 | 167 | height: selectionOutlineSize * count | 169 | height: selectionOutlineSize * count |
309 | 168 | width: parent.width | 170 | width: parent.width |
310 | 169 | interactive: false | 171 | interactive: false |
311 | 170 | 172 | ||
312 | === modified file 'shell/launcher/LauncherItem.qml' | |||
313 | --- shell/launcher/LauncherItem.qml 2012-01-10 17:14:44 +0000 | |||
314 | +++ shell/launcher/LauncherItem.qml 2012-01-16 18:02:25 +0000 | |||
315 | @@ -52,8 +52,11 @@ | |||
316 | 52 | 52 | ||
317 | 53 | anchors.horizontalCenter: parent.horizontalCenter | 53 | anchors.horizontalCenter: parent.horizontalCenter |
318 | 54 | 54 | ||
319 | 55 | height: selectionOutlineSize | ||
320 | 56 | |||
321 | 55 | property bool isBfb: false | 57 | property bool isBfb: false |
322 | 56 | property int tileSize | 58 | property int tileSize |
323 | 59 | property int selectionOutlineSize | ||
324 | 57 | property alias name: looseItem.objectName | 60 | property alias name: looseItem.objectName |
325 | 58 | property string desktopFile: "" | 61 | property string desktopFile: "" |
326 | 59 | property alias icon: icon.source | 62 | property alias icon: icon.source |
327 | @@ -132,13 +135,8 @@ | |||
328 | 132 | the active one */ | 135 | the active one */ |
329 | 133 | Image { | 136 | Image { |
330 | 134 | objectName: "active" | 137 | objectName: "active" |
331 | 135 | |||
332 | 136 | anchors.top: parent.top | ||
333 | 137 | anchors.bottom: parent.bottom | ||
334 | 138 | anchors.right: parent.right | 138 | anchors.right: parent.right |
338 | 139 | 139 | y: item.height - item.selectionOutlineSize / 2 - height / 2 | |
336 | 140 | width: parent.width * 0.15 | ||
337 | 141 | fillMode: Image.PreserveAspectFit | ||
339 | 142 | mirror: isRightToLeft() | 140 | mirror: isRightToLeft() |
340 | 143 | 141 | ||
341 | 144 | source: "image://blended/%1color=%2alpha=%3" | 142 | source: "image://blended/%1color=%2alpha=%3" |
342 | @@ -164,9 +162,7 @@ | |||
343 | 164 | printed for the following two anchor assignements. This fixes the | 162 | printed for the following two anchor assignements. This fixes the |
344 | 165 | problem, but I'm not sure if it should happen in the first place. */ | 163 | problem, but I'm not sure if it should happen in the first place. */ |
345 | 166 | anchors.left: (parent) ? parent.left : undefined | 164 | anchors.left: (parent) ? parent.left : undefined |
349 | 167 | width: parent.width * 0.15 | 165 | y: item.height - item.selectionOutlineSize / 2 - height / 2 + getPipOffset(index) |
347 | 168 | height: width * sourceSize.height / sourceSize.width | ||
348 | 169 | y: (item.height - height) / 2 + getPipOffset(index) * 0.015 * item.height | ||
350 | 170 | mirror: isRightToLeft() | 166 | mirror: isRightToLeft() |
351 | 171 | 167 | ||
352 | 172 | source: "image://blended/%1color=%2alpha=%3" | 168 | source: "image://blended/%1color=%2alpha=%3" |
353 | @@ -216,6 +212,8 @@ | |||
354 | 216 | running: launching | 212 | running: launching |
355 | 217 | } | 213 | } |
356 | 218 | 214 | ||
357 | 215 | sourceSize.width: item.tileSize | ||
358 | 216 | sourceSize.height: item.tileSize | ||
359 | 219 | source: { | 217 | source: { |
360 | 220 | if (isBfb) { | 218 | if (isBfb) { |
361 | 221 | if (declarativeView.focus && item.activeFocus) { | 219 | if (declarativeView.focus && item.activeFocus) { |
362 | @@ -240,6 +238,8 @@ | |||
363 | 240 | anchors.fill: parent | 238 | anchors.fill: parent |
364 | 241 | smooth: true | 239 | smooth: true |
365 | 242 | 240 | ||
366 | 241 | sourceSize.width: item.tileSize | ||
367 | 242 | sourceSize.height: item.tileSize | ||
368 | 243 | source: "artwork/round_outline_54x54.png" | 243 | source: "artwork/round_outline_54x54.png" |
369 | 244 | 244 | ||
370 | 245 | opacity: 0 | 245 | opacity: 0 |
371 | @@ -258,13 +258,11 @@ | |||
372 | 258 | Image { | 258 | Image { |
373 | 259 | id: icon | 259 | id: icon |
374 | 260 | objectName: "icon" | 260 | objectName: "icon" |
378 | 261 | 261 | anchors.centerIn: parent | |
376 | 262 | anchors.fill: parent | ||
377 | 263 | anchors.margins: parent.width * 0.056 | ||
379 | 264 | smooth: true | 262 | smooth: true |
380 | 265 | 263 | ||
383 | 266 | sourceSize.width: Math.max(width, 16) | 264 | sourceSize.width: 48 |
384 | 267 | sourceSize.height: Math.max(height, 16) | 265 | sourceSize.height: 48 |
385 | 268 | 266 | ||
386 | 269 | /* Whenever one of the parameters used in calculating the background color of | 267 | /* Whenever one of the parameters used in calculating the background color of |
387 | 270 | the icon changes, recalculate its value */ | 268 | the icon changes, recalculate its value */ |
388 | @@ -288,14 +286,14 @@ | |||
389 | 288 | smooth: true | 286 | smooth: true |
390 | 289 | 287 | ||
391 | 290 | source: isBfb ? "artwork/squircle_shine_54.png" : "artwork/round_shine_54x54.png" | 288 | source: isBfb ? "artwork/squircle_shine_54.png" : "artwork/round_shine_54x54.png" |
392 | 289 | sourceSize.width: item.tileSize | ||
393 | 290 | sourceSize.height: item.tileSize | ||
394 | 291 | } | 291 | } |
395 | 292 | 292 | ||
396 | 293 | Image { | 293 | Image { |
397 | 294 | id: selectionOutline | 294 | id: selectionOutline |
398 | 295 | objectName: "selectionOutline" | 295 | objectName: "selectionOutline" |
399 | 296 | anchors.centerIn: parent | 296 | anchors.centerIn: parent |
400 | 297 | width: item.width | ||
401 | 298 | height: item.height | ||
402 | 299 | smooth: true | 297 | smooth: true |
403 | 300 | source: isBfb ? "artwork/squircle_glow_54.png" : "artwork/round_selected_66x66.png" | 298 | source: isBfb ? "artwork/squircle_glow_54.png" : "artwork/round_selected_66x66.png" |
404 | 301 | visible: declarativeView.focus && item.activeFocus | 299 | visible: declarativeView.focus && item.activeFocus |
405 | @@ -303,22 +301,22 @@ | |||
406 | 303 | 301 | ||
407 | 304 | Rectangle { | 302 | Rectangle { |
408 | 305 | id: counter | 303 | id: counter |
411 | 306 | height: width / 2 - border.width | 304 | height: 16 - border.width |
412 | 307 | width: parent.width * 0.59 | 305 | width: 32 |
413 | 308 | // Using anchors the item will be 1 pixel off with respect to Unity | 306 | // Using anchors the item will be 1 pixel off with respect to Unity |
414 | 309 | y: 1 | 307 | y: 1 |
415 | 310 | x: 1 | 308 | x: 1 |
416 | 311 | radius: height / 2 - 1 | 309 | radius: height / 2 - 1 |
417 | 312 | smooth: true | 310 | smooth: true |
419 | 313 | border.width: width / 16 | 311 | border.width: 2 |
420 | 314 | border.color: "white" | 312 | border.color: "white" |
421 | 315 | color: "#595959" | 313 | color: "#595959" |
422 | 316 | visible: launcherItem.counterVisible | 314 | visible: launcherItem.counterVisible |
423 | 317 | 315 | ||
424 | 318 | Text { | 316 | Text { |
425 | 319 | anchors.centerIn: parent | 317 | anchors.centerIn: parent |
428 | 320 | font.pixelSize: parent.height * 0.79 | 318 | font.pixelSize: parent.height - 3 |
429 | 321 | width: parent.width * 0.84 | 319 | width: parent.width - 5 |
430 | 322 | smooth: true | 320 | smooth: true |
431 | 323 | elide: Text.ElideRight | 321 | elide: Text.ElideRight |
432 | 324 | horizontalAlignment: Text.AlignHCenter | 322 | horizontalAlignment: Text.AlignHCenter |
433 | @@ -331,8 +329,7 @@ | |||
434 | 331 | id: progressBar | 329 | id: progressBar |
435 | 332 | objectName: "progressBar" | 330 | objectName: "progressBar" |
436 | 333 | source: "artwork/progress_bar_trough.png" | 331 | source: "artwork/progress_bar_trough.png" |
439 | 334 | anchors.top: parent.top | 332 | anchors.verticalCenter: parent.verticalCenter |
438 | 335 | anchors.bottom: parent.bottom | ||
440 | 336 | anchors.left: parent.left | 333 | anchors.left: parent.left |
441 | 337 | width: tile.width | 334 | width: tile.width |
442 | 338 | smooth: true | 335 | smooth: true |
443 | @@ -341,10 +338,9 @@ | |||
444 | 341 | Image { | 338 | Image { |
445 | 342 | id: progressFill | 339 | id: progressFill |
446 | 343 | source: "artwork/progress_bar_fill.png" | 340 | source: "artwork/progress_bar_fill.png" |
451 | 344 | x: parent.width * 0.11 | 341 | anchors.verticalCenter: parent.verticalCenter |
452 | 345 | y: (parent.height - height) / 2 | 342 | x: 6 |
453 | 346 | width: parent.width * 0.78 * launcherItem.progress | 343 | width: sourceSize.width * launcherItem.progress |
450 | 347 | height: parent.height * 0.074 | ||
454 | 348 | smooth: true | 344 | smooth: true |
455 | 349 | 345 | ||
456 | 350 | Behavior on width { | 346 | Behavior on width { |
457 | @@ -377,8 +373,8 @@ | |||
458 | 377 | anchors.centerIn: parent | 373 | anchors.centerIn: parent |
459 | 378 | color: "#B3000000" // 0.7 opacity on black | 374 | color: "#B3000000" // 0.7 opacity on black |
460 | 379 | radius: 2 | 375 | radius: 2 |
463 | 380 | width: parent.width * 0.41 | 376 | width: 22 |
464 | 381 | height: parent.height * 0.41 | 377 | height: 22 |
465 | 382 | smooth: true | 378 | smooth: true |
466 | 383 | 379 | ||
467 | 384 | Text { | 380 | Text { |
468 | @@ -386,7 +382,6 @@ | |||
469 | 386 | anchors.centerIn: parent | 382 | anchors.centerIn: parent |
470 | 387 | color: "white" | 383 | color: "white" |
471 | 388 | smooth: true | 384 | smooth: true |
472 | 389 | font.pixelSize: parent.height * 0.7 | ||
473 | 390 | } | 385 | } |
474 | 391 | } | 386 | } |
475 | 392 | 387 | ||
476 | 393 | 388 | ||
477 | === modified file 'shell/launcher/LauncherList.qml' | |||
478 | --- shell/launcher/LauncherList.qml 2012-01-10 17:14:44 +0000 | |||
479 | +++ shell/launcher/LauncherList.qml 2012-01-16 18:02:25 +0000 | |||
480 | @@ -25,13 +25,13 @@ | |||
481 | 25 | 25 | ||
482 | 26 | /* The spacing is explicitly set in order to compensate | 26 | /* The spacing is explicitly set in order to compensate |
483 | 27 | the space added by selectionOutline and round_corner_54x54.png. */ | 27 | the space added by selectionOutline and round_corner_54x54.png. */ |
485 | 28 | spacing: -width * 0.12 // FIXME: live update broken by this code | 28 | spacing: -8 |
486 | 29 | 29 | ||
488 | 30 | property int tileSize: width * 0.82 | 30 | property int tileSize: 54 |
489 | 31 | 31 | ||
490 | 32 | /* selectionOutline tile size, so AutoScrollingList view can calculate | 32 | /* selectionOutline tile size, so AutoScrollingList view can calculate |
491 | 33 | the right height. */ | 33 | the right height. */ |
493 | 34 | property int selectionOutlineSize: width // this is the size of an item; items are square | 34 | property int selectionOutlineSize: 65 |
494 | 35 | 35 | ||
495 | 36 | /* Keep a reference to the currently visible contextual menu */ | 36 | /* Keep a reference to the currently visible contextual menu */ |
496 | 37 | property variant visibleMenu | 37 | property variant visibleMenu |
497 | @@ -96,8 +96,8 @@ | |||
498 | 96 | name: item.name | 96 | name: item.name |
499 | 97 | 97 | ||
500 | 98 | width: list.width | 98 | width: list.width |
501 | 99 | height: width | ||
502 | 100 | tileSize: list.tileSize | 99 | tileSize: list.tileSize |
503 | 100 | selectionOutlineSize: list.selectionOutlineSize | ||
504 | 101 | 101 | ||
505 | 102 | desktopFile: item.desktop_file ? item.desktop_file : "" | 102 | desktopFile: item.desktop_file ? item.desktop_file : "" |
506 | 103 | icon: item.icon != "" ? "image://icons/" + item.icon : "image://icons/unknown" | 103 | icon: item.icon != "" ? "image://icons/" + item.icon : "image://icons/unknown" |