Merge lp:~feng-kylin/unity8/AddIndicationForRunningApp into lp:unity8

Proposed by handsome_feng
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1854
Merged at revision: 1910
Proposed branch: lp:~feng-kylin/unity8/AddIndicationForRunningApp
Merge into: lp:unity8
Prerequisite: lp:~lukas-kde/unity8/closeAppsFromQuicklist
Diff against target: 100 lines (+38/-1)
5 files modified
plugins/Unity/Launcher/launchermodel.cpp (+0/-1)
qml/Launcher/LauncherDelegate.qml (+12/-0)
qml/Launcher/LauncherPanel.qml (+1/-0)
tests/plugins/Unity/Launcher/launchermodeltest.cpp (+16/-0)
tests/qmltests/Launcher/tst_Launcher.qml (+9/-0)
To merge this branch: bzr merge lp:~feng-kylin/unity8/AddIndicationForRunningApp
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Michael Zanetti Pending
Review via email: mp+266181@code.launchpad.net

This proposal supersedes a proposal from 2015-07-14.

Commit message

Added indication for running apps.

Description of the change

Add indication for the running apps.

* Are there any related MPs required for this MP to build/function as expected? Please list.

no

 * Did you perform an exploratory manual test run of your code change and any related functionality?

yes

 * Did you make sure that your branch does not contain spurious tags?

yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

n/a

 * If you changed the UI, has there been a design review?

no

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

The code looks mostly ok (I've left 3 inline comments) and it works fine in make tryLauncher. However, testing it on the phone it doesn't work. No running icon painted :/

review: Needs Fixing
Revision history for this message
handsome_feng (feng-kylin) wrote : Posted in a previous version of this proposal

> The code looks mostly ok (I've left 3 inline comments) and it works fine in
> make tryLauncher. However, testing it on the phone it doesn't work. No running
> icon painted :/

hmm... unfortunately,there are some problems on my nexus4 now.
But i will test this as soon as possible when my phone is repaired.

Revision history for this message
handsome_feng (feng-kylin) wrote : Posted in a previous version of this proposal

Seems like a bug in unity8. I use the trunk code to test,run unity8 trough qtcreate repeatedly, it also got a "QML Image: Cannot open: file:///home/phablet/shell/qml/Launcher/graphics/focused_app_arrow.png" error, and the indication for focused app disappeared. hm... Keep investigating this.

Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

actually I'm wondering if we really need to add the running_app_icon. isn't it just the same as the "focused_app_arrow" one? I guess we could rotate in code, at least until design gives a new one.

Revision history for this message
handsome_feng (feng-kylin) wrote : Posted in a previous version of this proposal

> actually I'm wondering if we really need to add the running_app_icon. isn't it
> just the same as the "focused_app_arrow" one? I guess we could rotate in code,
> at least until design gives a new one.

hm, I agree with you, so rotating it in code first.

Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

Ok, I've tested this and it seems to work fine now.

Please rebase on https://code.launchpad.net/~lukas-kde/unity8/closeAppsFromQuicklist/+merge/265669 which is already in a silo and about to land.

We'll get this in with the next silo then.

Thanks a lot for your contributions!

Revision history for this message
Albert Astals Cid (aacid) wrote :

 * 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.
CI can't even compile at this stage, i've run relevant tests locally and seems fine.

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Unity/Launcher/launchermodel.cpp'
2--- plugins/Unity/Launcher/launchermodel.cpp 2015-07-29 05:57:57 +0000
3+++ plugins/Unity/Launcher/launchermodel.cpp 2015-07-29 05:57:57 +0000
4@@ -517,7 +517,6 @@
5 Q_EMIT dataChanged(index(itemIndex), index(itemIndex), {RoleRecent});
6 }
7 item->setRunning(true);
8- // TODO Shall we paint some running/recent app highlight? If yes, do it here.
9 } else {
10 LauncherItem *item = new LauncherItem(app->appId(), app->name(), app->icon().toString(), this);
11 item->setRecent(true);
12
13=== modified file 'qml/Launcher/LauncherDelegate.qml'
14--- qml/Launcher/LauncherDelegate.qml 2015-07-29 05:57:57 +0000
15+++ qml/Launcher/LauncherDelegate.qml 2015-07-29 05:57:57 +0000
16@@ -24,6 +24,7 @@
17 property int count: 0
18 property bool countVisible: false
19 property int progress: -1
20+ property bool itemRunning: false
21 property bool itemFocused: false
22 property real maxAngle: 0
23 property bool inverted: false
24@@ -217,6 +218,17 @@
25 }
26
27 Image {
28+ objectName: "runningHighlight"
29+ anchors {
30+ left: parent.left
31+ verticalCenter: parent.verticalCenter
32+ }
33+ visible: root.itemRunning
34+ rotation: 180
35+ source: "graphics/focused_app_arrow.png"
36+ }
37+
38+ Image {
39 objectName: "focusedHighlight"
40 anchors {
41 right: parent.right
42
43=== modified file 'qml/Launcher/LauncherPanel.qml'
44--- qml/Launcher/LauncherPanel.qml 2015-07-29 05:57:57 +0000
45+++ qml/Launcher/LauncherPanel.qml 2015-07-29 05:57:57 +0000
46@@ -196,6 +196,7 @@
47 count: model.count
48 countVisible: model.countVisible
49 progress: model.progress
50+ itemRunning: model.running
51 itemFocused: model.focused
52 inverted: root.inverted
53 alerting: model.alerting
54
55=== modified file 'tests/plugins/Unity/Launcher/launchermodeltest.cpp'
56--- tests/plugins/Unity/Launcher/launchermodeltest.cpp 2015-07-29 05:57:57 +0000
57+++ tests/plugins/Unity/Launcher/launchermodeltest.cpp 2015-07-29 05:57:57 +0000
58@@ -299,6 +299,22 @@
59 QCOMPARE(launcherModel->rowCount(QModelIndex()), 1);
60 }
61
62+ void testApplicationRunning() {
63+ launcherModel->pin("abs-icon");
64+ launcherModel->pin("no-icon");
65+
66+ QCOMPARE(launcherModel->get(0)->running(), true);
67+ QCOMPARE(launcherModel->get(1)->running(), true);
68+
69+ appManager->stopApplication("abs-icon");
70+ QCOMPARE(launcherModel->get(0)->running(), false);
71+ QCOMPARE(launcherModel->get(1)->running(), true);
72+
73+ appManager->stopApplication("no-icon");
74+ QCOMPARE(launcherModel->get(0)->running(), false);
75+ QCOMPARE(launcherModel->get(1)->running(), false);
76+ }
77+
78 void testApplicationFocused() {
79 // all apps unfocused at beginning...
80 QCOMPARE(launcherModel->get(0)->focused(), false);
81
82=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
83--- tests/qmltests/Launcher/tst_Launcher.qml 2015-07-29 05:57:57 +0000
84+++ tests/qmltests/Launcher/tst_Launcher.qml 2015-07-29 05:57:57 +0000
85@@ -382,6 +382,15 @@
86 }
87 }
88
89+ function test_runningHighlight() {
90+ dragLauncherIntoView();
91+ var launcherListView = findChild(launcher, "launcherListView");
92+ for (var i = 0; i < launcherListView.count; ++i) {
93+ var delegate = findChild(launcherListView, "launcherDelegate" + i)
94+ compare(findChild(delegate, "runningHighlight").visible, LauncherModel.get(i).running)
95+ }
96+ }
97+
98 function test_focusedHighlight() {
99 dragLauncherIntoView();
100 var launcherListView = findChild(launcher, "launcherListView");

Subscribers

People subscribed via source and target branches