Merge lp:~cimi/unity8/tweaks-libertine-scope into lp:unity8

Proposed by Andrea Cimitan
Status: Superseded
Proposed branch: lp:~cimi/unity8/tweaks-libertine-scope
Merge into: lp:unity8
Diff against target: 170 lines (+40/-12)
7 files modified
plugins/Dash/CardCreatorCache.qml (+1/-1)
qml/Dash/CardTool.qml (+2/-2)
qml/Dash/GenericScopeView.qml (+6/-5)
tests/mocks/Unity/fake_scopes.cpp (+1/-0)
tests/qmltests/Dash/tst_Dash.qml (+28/-2)
tests/qmltests/Dash/tst_DashContent.qml (+1/-1)
tests/qmltests/Dash/tst_DashShell.qml (+1/-1)
To merge this branch: bzr merge lp:~cimi/unity8/tweaks-libertine-scope
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+296657@code.launchpad.net

This proposal has been superseded by a proposal from 2016-06-07.

Commit message

Same tweaks we have for click scope now for libertine

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
no, but you need latest libertine-scope
 * Did you perform an exploratory manual test run of your code change and any related functionality?
y
 * 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?
n/a

To post a comment you must log in.
2445. By Andrea Cimitan

libertine can be unfavorited

Unmerged revisions

2441. By Launchpad Translations on behalf of unity-team

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/CardCreatorCache.qml'
2--- plugins/Dash/CardCreatorCache.qml 2016-03-04 13:57:48 +0000
3+++ plugins/Dash/CardCreatorCache.qml 2016-06-07 13:19:08 +0000
4@@ -29,7 +29,7 @@
5
6 var tString = JSON.stringify(template);
7 var cString = JSON.stringify(components);
8- var allString = tString + cString + isCardTool;
9+ var allString = tString + cString + isCardTool + artShapeStyle;
10 var component = cache[allString];
11 if (component === undefined) {
12 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
13
14=== modified file 'qml/Dash/CardTool.qml'
15--- qml/Dash/CardTool.qml 2016-05-09 08:34:38 +0000
16+++ qml/Dash/CardTool.qml 2016-06-07 13:19:08 +0000
17@@ -70,7 +70,7 @@
18 // Not readonly because gets overwritten from GenericScopeView in some cases
19 property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
20
21- property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, artShapeStyle);
22+ property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, cardTool.artShapeStyle);
23
24 // FIXME: Saviq
25 // Only way for the card below to actually be laid out completely.
26@@ -212,7 +212,7 @@
27 "attributes": attributesModel.model,
28 "socialActions": socialActionsModel.model
29 }
30- sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, artShapeStyle);
31+ sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, cardTool.artShapeStyle);
32 onLoaded: {
33 item.objectName = "cardToolCard";
34 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
35
36=== modified file 'qml/Dash/GenericScopeView.qml'
37--- qml/Dash/GenericScopeView.qml 2016-05-27 13:52:20 +0000
38+++ qml/Dash/GenericScopeView.qml 2016-06-07 13:19:08 +0000
39@@ -342,8 +342,8 @@
40 }
41 updateRanges();
42 clickScopeSizingHacks();
43- if (scope && scope.id === "clickscope") {
44- if (categoryId === "predefined" || categoryId === "local") {
45+ if (scope && (scope.id === "clickscope" || scope.id === "libertine-scope.ubuntu_libertine-scope")) {
46+ if (scope.id === "libertine-scope.ubuntu_libertine-scope" || categoryId === "predefined" || categoryId === "local") {
47 cardTool.artShapeSize = Qt.binding(function() { return Qt.size(units.gu(8), units.gu(7.5)) });
48 cardTool.artShapeStyle = "icon";
49 } else {
50@@ -367,8 +367,9 @@
51 onPxpguChanged: clickScopeSizingHacks();
52
53 function clickScopeSizingHacks() {
54- if (scope && scope.id === "clickscope" &&
55- (categoryId === "predefined" || categoryId === "local")) {
56+ if (scope &&
57+ ((scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) ||
58+ scope.id === "libertine-scope.ubuntu_libertine-scope")) {
59 // Yeah, hackish :/
60 if (scopeView.width > units.gu(45)) {
61 if (scopeView.width >= units.gu(70)) {
62@@ -639,7 +640,7 @@
63 showBackButton: scopeView.hasBackAction
64 searchEntryEnabled: true
65 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
66- favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope"
67+ favoriteEnabled: scopeView.scope && scopeView.scope.id !== "clickscope" && scopeView.scope.id !== "libertine-scope.ubuntu_libertine-scope"
68 favorite: scopeView.scope && scopeView.scope.favorite
69 navigationTag: scopeView.scope ? scopeView.scope.primaryNavigationTag : ""
70 scopeStyle: scopeView.scopeStyle
71
72=== modified file 'tests/mocks/Unity/fake_scopes.cpp'
73--- tests/mocks/Unity/fake_scopes.cpp 2016-04-29 14:57:44 +0000
74+++ tests/mocks/Unity/fake_scopes.cpp 2016-06-07 13:19:08 +0000
75@@ -60,6 +60,7 @@
76 addScope(new Scope("MockScope7", "MS7", false, this));
77 addScope(new Scope("MockScope8", "MS8", false, this));
78 addScope(new Scope("MockScope9", "MS9", false, this));
79+ addScope(new Scope("libertine-scope.ubuntu_libertine-scope", "Libertine", true, this));
80
81 Scope *longNavigationScope = new Scope(
82 "LongPrimaryNavigation", "LongPrimaryNavigation", true, this, 1, false,
83
84=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
85--- tests/qmltests/Dash/tst_Dash.qml 2016-05-27 13:54:07 +0000
86+++ tests/qmltests/Dash/tst_Dash.qml 2016-06-07 13:19:08 +0000
87@@ -58,7 +58,7 @@
88 tryCompare(dashContentList, "count", 0);
89 scopes.load();
90 tryCompare(dashContentList, "currentIndex", 0);
91- tryCompare(dashContentList, "count", 7);
92+ tryCompare(dashContentList, "count", 8);
93 tryCompare(scopes, "loaded", true);
94 tryCompareFunction(function() {
95 var mockScope1Loader = findChild(dash, "scopeLoader0");
96@@ -88,7 +88,7 @@
97 return findChild(genericScopeView, categoryName);
98 }
99
100- function clickCategoryDelegate(category, delegate) {
101+ function getCategoryDelegate(category, delegate) {
102 var dashContentList = findChild(dash, "dashContentList");
103 var genericScopeView = dashContentList.currentItem;
104 if (category === undefined) category = 0;
105@@ -104,6 +104,11 @@
106 true);
107 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
108 waitForRendering(tile);
109+ return tile;
110+ }
111+
112+ function clickCategoryDelegate(category, delegate) {
113+ var tile = getCategoryDelegate(category, delegate);
114 mouseClick(tile);
115 }
116
117@@ -637,6 +642,27 @@
118 tryCompare(dashContent, "x", 0);
119 }
120
121+ function test_cardIconStyle()
122+ {
123+ dash.setCurrentScope("clickscope");
124+ var dashContent = findChild(dash, "dashContent");
125+ tryCompare(dashContent.currentScope, "id", "clickscope");
126+
127+ scrollToCategory("dashCategorypredefined");
128+ var tile = getCategoryDelegate("predefined", 2);
129+ var proportionalShape = findChildsByType(tile, "UCProportionalShape");
130+ compare(proportionalShape.length, 1);
131+
132+ dash.setCurrentScope("libertine-scope.ubuntu_libertine-scope");
133+ var dashContent = findChild(dash, "dashContent");
134+ tryCompare(dashContent.currentScope, "id", "libertine-scope.ubuntu_libertine-scope");
135+
136+ scrollToCategory("dashCategory2");
137+ tile = getCategoryDelegate("2", 2);
138+ proportionalShape = findChildsByType(tile, "UCProportionalShape");
139+ compare(proportionalShape.length, 1);
140+ }
141+
142 function test_tempScopeItemXOnResize()
143 {
144 // Go to a temp scope
145
146=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
147--- tests/qmltests/Dash/tst_DashContent.qml 2016-05-27 13:52:20 +0000
148+++ tests/qmltests/Dash/tst_DashContent.qml 2016-06-07 13:19:08 +0000
149@@ -124,7 +124,7 @@
150
151 loadScopes();
152
153- compare(dashContentList.count, 7);
154+ compare(dashContentList.count, 8);
155 verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < dashContentList.count);
156 }
157
158
159=== modified file 'tests/qmltests/Dash/tst_DashShell.qml'
160--- tests/qmltests/Dash/tst_DashShell.qml 2016-05-03 22:39:09 +0000
161+++ tests/qmltests/Dash/tst_DashShell.qml 2016-06-07 13:19:08 +0000
162@@ -60,7 +60,7 @@
163 tryCompare(dashContentList, "count", 0);
164 scopes.load();
165 tryCompare(dashContentList, "currentIndex", 0);
166- tryCompare(dashContentList, "count", 7);
167+ tryCompare(dashContentList, "count", 8);
168 tryCompare(scopes, "loaded", true);
169 tryCompareFunction(function() {
170 var mockScope1Loader = findChild(dash, "scopeLoader0");

Subscribers

People subscribed via source and target branches