Merge lp:~aacid/unity8/spacier_drawer into lp:unity8
- spacier_drawer
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Lukáš Tinkl |
Approved revision: | 2917 |
Merged at revision: | 2920 |
Proposed branch: | lp:~aacid/unity8/spacier_drawer |
Merge into: | lp:unity8 |
Diff against target: |
101 lines (+44/-3) 2 files modified
qml/Launcher/Drawer.qml (+43/-2) tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp (+1/-1) |
To merge this branch: | bzr merge lp:~aacid/unity8/spacier_drawer |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lukáš Tinkl (community) | Approve | ||
Unity8 CI Bot | continuous-integration | Approve | |
Review via email: mp+321720@code.launchpad.net |
Commit message
Tweak app drawer a bit
Make delegates a bit wider to have more breath space
Add a "tooltip" on hover for delegates whose text is truncated
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
No
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* If you changed the UI, has there been a design review?
No, needs one?
Albert Astals Cid (aacid) wrote : | # |
> Code looks good but could you get rid of the hardcoded colors?
>
> color: UbuntuColors.jet
> border.color: UbuntuColors.blue
I can if you suggest me something better.
FWIW the file is already a bit meh using "#BF000000" and "#20ffffff"
- 2915. By Albert Astals Cid
-
Make longer so that tryDrawer has one elided item
Lukáš Tinkl (lukas-kde) wrote : | # |
OK, looks and works good enough for me; the "blue" color stands out a bit too much but I don't want to block on that.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2914
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2915
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2915
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2916. By Albert Astals Cid
-
Limit fullLabel width and height
Also remove blue outline
- 2917. By Albert Astals Cid
-
also show the fulllabel if focused
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2916
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2917
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Lukáš Tinkl (lukas-kde) wrote : | # |
Yes, looks nice and works as expected
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass? If not, please explain why.
Yes
Preview Diff
1 | === modified file 'qml/Launcher/Drawer.qml' | |||
2 | --- qml/Launcher/Drawer.qml 2017-03-24 11:51:31 +0000 | |||
3 | +++ qml/Launcher/Drawer.qml 2017-04-04 11:14:47 +0000 | |||
4 | @@ -28,6 +28,7 @@ | |||
5 | 28 | property int panelWidth: 0 | 28 | property int panelWidth: 0 |
6 | 29 | readonly property bool moving: listLoader.item && listLoader.item.moving | 29 | readonly property bool moving: listLoader.item && listLoader.item.moving |
7 | 30 | readonly property Item searchTextField: searchField | 30 | readonly property Item searchTextField: searchField |
8 | 31 | readonly property real delegateWidth: units.gu(10) | ||
9 | 31 | 32 | ||
10 | 32 | signal applicationSelected(string appId) | 33 | signal applicationSelected(string appId) |
11 | 33 | 34 | ||
12 | @@ -272,7 +273,7 @@ | |||
13 | 272 | 273 | ||
14 | 273 | model: sortProxyModel | 274 | model: sortProxyModel |
15 | 274 | 275 | ||
17 | 275 | delegateWidth: units.gu(8) | 276 | delegateWidth: root.delegateWidth |
18 | 276 | delegateHeight: units.gu(10) | 277 | delegateHeight: units.gu(10) |
19 | 277 | delegate: drawerDelegateComponent | 278 | delegate: drawerDelegateComponent |
20 | 278 | } | 279 | } |
21 | @@ -332,7 +333,7 @@ | |||
22 | 332 | filterLetter: model.letter | 333 | filterLetter: model.letter |
23 | 333 | dynamicSortFilter: false | 334 | dynamicSortFilter: false |
24 | 334 | } | 335 | } |
26 | 335 | delegateWidth: units.gu(8) | 336 | delegateWidth: root.delegateWidth |
27 | 336 | delegateHeight: units.gu(10) | 337 | delegateHeight: units.gu(10) |
28 | 337 | delegate: drawerDelegateComponent | 338 | delegate: drawerDelegateComponent |
29 | 338 | } | 339 | } |
30 | @@ -352,6 +353,7 @@ | |||
31 | 352 | readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus | 353 | readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus |
32 | 353 | 354 | ||
33 | 354 | onClicked: root.applicationSelected(model.appId) | 355 | onClicked: root.applicationSelected(model.appId) |
34 | 356 | z: loader.active ? 1 : 0 | ||
35 | 355 | 357 | ||
36 | 356 | Column { | 358 | Column { |
37 | 357 | width: units.gu(8) | 359 | width: units.gu(8) |
38 | @@ -384,11 +386,50 @@ | |||
39 | 384 | } | 386 | } |
40 | 385 | 387 | ||
41 | 386 | Label { | 388 | Label { |
42 | 389 | id: label | ||
43 | 387 | text: model.name | 390 | text: model.name |
44 | 388 | width: parent.width | 391 | width: parent.width |
45 | 389 | horizontalAlignment: Text.AlignHCenter | 392 | horizontalAlignment: Text.AlignHCenter |
46 | 390 | fontSize: "small" | 393 | fontSize: "small" |
47 | 391 | elide: Text.ElideRight | 394 | elide: Text.ElideRight |
48 | 395 | |||
49 | 396 | Loader { | ||
50 | 397 | id: loader | ||
51 | 398 | x: { | ||
52 | 399 | var aux = 0; | ||
53 | 400 | if (item) { | ||
54 | 401 | aux = label.width / 2 - item.width / 2; | ||
55 | 402 | var containerXMap = mapToItem(contentContainer, aux, 0).x | ||
56 | 403 | if (containerXMap < 0) { | ||
57 | 404 | aux = aux - containerXMap; | ||
58 | 405 | containerXMap = 0; | ||
59 | 406 | } | ||
60 | 407 | if (containerXMap + item.width > contentContainer.width) { | ||
61 | 408 | aux = aux - (containerXMap + item.width - contentContainer.width); | ||
62 | 409 | } | ||
63 | 410 | } | ||
64 | 411 | return aux; | ||
65 | 412 | } | ||
66 | 413 | y: -units.gu(0.5) | ||
67 | 414 | active: label.truncated && (drawerDelegate.hovered || drawerDelegate.focused) | ||
68 | 415 | sourceComponent: Rectangle { | ||
69 | 416 | color: UbuntuColors.jet | ||
70 | 417 | width: fullLabel.contentWidth + units.gu(1) | ||
71 | 418 | height: fullLabel.height + units.gu(1) | ||
72 | 419 | radius: units.dp(4) | ||
73 | 420 | Label { | ||
74 | 421 | id: fullLabel | ||
75 | 422 | width: Math.min(root.delegateWidth * 2, implicitWidth) | ||
76 | 423 | wrapMode: Text.Wrap | ||
77 | 424 | horizontalAlignment: Text.AlignHCenter | ||
78 | 425 | maximumLineCount: 3 | ||
79 | 426 | elide: Text.ElideRight | ||
80 | 427 | anchors.centerIn: parent | ||
81 | 428 | text: model.name | ||
82 | 429 | fontSize: "small" | ||
83 | 430 | } | ||
84 | 431 | } | ||
85 | 432 | } | ||
86 | 392 | } | 433 | } |
87 | 393 | } | 434 | } |
88 | 394 | } | 435 | } |
89 | 395 | 436 | ||
90 | === modified file 'tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp' | |||
91 | --- tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp 2017-01-16 11:12:00 +0000 | |||
92 | +++ tests/mocks/Unity/Launcher/MockAppDrawerModel.cpp 2017-04-04 11:14:47 +0000 | |||
93 | @@ -46,7 +46,7 @@ | |||
94 | 46 | m_list.append(item); | 46 | m_list.append(item); |
95 | 47 | item = new MockLauncherItem("calendar-app", "/usr/share/applications/calendar-app.desktop","Calendar", "calendar", this); | 47 | item = new MockLauncherItem("calendar-app", "/usr/share/applications/calendar-app.desktop","Calendar", "calendar", this); |
96 | 48 | m_list.append(item); | 48 | m_list.append(item); |
98 | 49 | item = new MockLauncherItem("libreoffice", "/usr/share/applications/libreoffice.desktop","Libre Office", "libreoffice", this); | 49 | item = new MockLauncherItem("libreoffice", "/usr/share/applications/libreoffice.desktop","Libre Office Writer", "libreoffice", this); |
99 | 50 | m_list.append(item); | 50 | m_list.append(item); |
100 | 51 | 51 | ||
101 | 52 | qsrand(QDateTime::currentMSecsSinceEpoch() / 1000); | 52 | qsrand(QDateTime::currentMSecsSinceEpoch() / 1000); |
Code looks good but could you get rid of the hardcoded colors?
color: UbuntuColors.jet
border.color: UbuntuColors.blue