Merge lp:~aacid/unity8/spacier_drawer into lp:unity8

Proposed by Albert Astals Cid on 2017-04-03
Status: Merged
Approved by: Lukáš Tinkl on 2017-04-04
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
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) 2017-04-03 Approve on 2017-04-04
Unity8 CI Bot continuous-integration Approve on 2017-04-04
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?

To post a comment you must log in.
Lukáš Tinkl (lukas-kde) wrote :

Code looks good but could you get rid of the hardcoded colors?

color: UbuntuColors.jet
border.color: UbuntuColors.blue

review: Needs Information
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"

lp:~aacid/unity8/spacier_drawer updated on 2017-04-03
2915. By Albert Astals Cid on 2017-04-03

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.

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2914
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3647/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4840
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2964
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2964
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4868
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4679
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4679/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4679
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4679/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4679
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4679/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4679
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4679/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4679
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4679/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4679
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4679/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3647/rebuild

review: Approve (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2915
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3652/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4846
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2970
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2970
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4874
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4685
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4685/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4685
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4685/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4685
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4685/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4685
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4685/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4685
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4685/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4685
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4685/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3652/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2915
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3656/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4850
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2972
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2972
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4878
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4689/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3656/rebuild

review: Approve (continuous-integration)
lp:~aacid/unity8/spacier_drawer updated on 2017-04-04
2916. By Albert Astals Cid on 2017-04-04

Limit fullLabel width and height

Also remove blue outline

2917. By Albert Astals Cid on 2017-04-04

also show the fulllabel if focused

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2916
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3660/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4858
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2975
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2975
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4886
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4697
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4697/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4697
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4697/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4697
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4697/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4697
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4697/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4697
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4697/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4697
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4697/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3660/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2917
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3662/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4863
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2980
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2980
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4891
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4702/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3662/rebuild

review: Approve (continuous-integration)
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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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 property int panelWidth: 0
6 readonly property bool moving: listLoader.item && listLoader.item.moving
7 readonly property Item searchTextField: searchField
8+ readonly property real delegateWidth: units.gu(10)
9
10 signal applicationSelected(string appId)
11
12@@ -272,7 +273,7 @@
13
14 model: sortProxyModel
15
16- delegateWidth: units.gu(8)
17+ delegateWidth: root.delegateWidth
18 delegateHeight: units.gu(10)
19 delegate: drawerDelegateComponent
20 }
21@@ -332,7 +333,7 @@
22 filterLetter: model.letter
23 dynamicSortFilter: false
24 }
25- delegateWidth: units.gu(8)
26+ delegateWidth: root.delegateWidth
27 delegateHeight: units.gu(10)
28 delegate: drawerDelegateComponent
29 }
30@@ -352,6 +353,7 @@
31 readonly property bool focused: index === GridView.view.currentIndex && GridView.view.activeFocus
32
33 onClicked: root.applicationSelected(model.appId)
34+ z: loader.active ? 1 : 0
35
36 Column {
37 width: units.gu(8)
38@@ -384,11 +386,50 @@
39 }
40
41 Label {
42+ id: label
43 text: model.name
44 width: parent.width
45 horizontalAlignment: Text.AlignHCenter
46 fontSize: "small"
47 elide: Text.ElideRight
48+
49+ Loader {
50+ id: loader
51+ x: {
52+ var aux = 0;
53+ if (item) {
54+ aux = label.width / 2 - item.width / 2;
55+ var containerXMap = mapToItem(contentContainer, aux, 0).x
56+ if (containerXMap < 0) {
57+ aux = aux - containerXMap;
58+ containerXMap = 0;
59+ }
60+ if (containerXMap + item.width > contentContainer.width) {
61+ aux = aux - (containerXMap + item.width - contentContainer.width);
62+ }
63+ }
64+ return aux;
65+ }
66+ y: -units.gu(0.5)
67+ active: label.truncated && (drawerDelegate.hovered || drawerDelegate.focused)
68+ sourceComponent: Rectangle {
69+ color: UbuntuColors.jet
70+ width: fullLabel.contentWidth + units.gu(1)
71+ height: fullLabel.height + units.gu(1)
72+ radius: units.dp(4)
73+ Label {
74+ id: fullLabel
75+ width: Math.min(root.delegateWidth * 2, implicitWidth)
76+ wrapMode: Text.Wrap
77+ horizontalAlignment: Text.AlignHCenter
78+ maximumLineCount: 3
79+ elide: Text.ElideRight
80+ anchors.centerIn: parent
81+ text: model.name
82+ fontSize: "small"
83+ }
84+ }
85+ }
86 }
87 }
88 }
89
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 m_list.append(item);
95 item = new MockLauncherItem("calendar-app", "/usr/share/applications/calendar-app.desktop","Calendar", "calendar", this);
96 m_list.append(item);
97- item = new MockLauncherItem("libreoffice", "/usr/share/applications/libreoffice.desktop","Libre Office", "libreoffice", this);
98+ item = new MockLauncherItem("libreoffice", "/usr/share/applications/libreoffice.desktop","Libre Office Writer", "libreoffice", this);
99 m_list.append(item);
100
101 qsrand(QDateTime::currentMSecsSinceEpoch() / 1000);

Subscribers

People subscribed via source and target branches