on xenial help sign in
Merge
bf74463Albert Astals
Dash/DashFilterGrid.qml+3−2
@@ -35,8 +35,6 @@ DashRenderer {
35 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
35 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
36 currentItem: filterGrid.currentItem
36 currentItem: filterGrid.currentItem
37 expandable: filterGrid.expandable
37 expandable: filterGrid.expandable
38− delegateCreationBegin: filterGrid.delegateCreationBegin
39− delegateCreationEnd: filterGrid.delegateCreationEnd
40 height: filterGrid.height
38 height: filterGrid.height
41 margins: filterGrid.margins
39 margins: filterGrid.margins
42 uncollapsedHeight: filterGrid.uncollapsedHeight
40 uncollapsedHeight: filterGrid.uncollapsedHeight
@@ -56,9 +54,12 @@ DashRenderer {
56 model: dashFilterGrid.model
54 model: dashFilterGrid.model
57 filter: dashFilterGrid.filter
55 filter: dashFilterGrid.filter
58 highlightIndex: dashFilterGrid.highlightIndex
56 highlightIndex: dashFilterGrid.highlightIndex
57+ delegateCreationBegin: dashFilterGrid.delegateCreationBegin
58+ delegateCreationEnd: dashFilterGrid.delegateCreationEnd
59
59
60 onFilterChanged: {
60 onFilterChanged: {
61 dashFilterGrid.filter = filter
61 dashFilterGrid.filter = filter
62+ filter = Qt.binding(function() { return dashFilterGrid.filter })
62 }
63 }
63 }
64 }
64}
65}
Dash/DashRenderer.qml+2−2
@@ -38,9 +38,9 @@ Item {
38
38
39 property int uncollapsedHeight: height
39 property int uncollapsedHeight: height
40
40
41− property real delegateCreationBegin
41+ property var delegateCreationBegin: undefined
42
42
43− property real delegateCreationEnd
43+ property var delegateCreationEnd: undefined
44
44
45 property real verticalSpacing: 0
45 property real verticalSpacing: 0
46
46
Panel/Panel.qml+22
@@ -31,6 +31,28 @@ Item {
31
31
32 signal searchClicked
32 signal searchClicked
33
33
34+ function hideIndicatorMenu(delay) {
35+ if (delay !== undefined) {
36+ hideTimer.interval = delay;
37+ hideTimer.start();
38+ } else {
39+ indicatorsMenu.hide();
40+ }
41+ }
42+
43+ Timer {
44+ id: hideTimer
45+ running: false
46+ onTriggered: {
47+ indicatorsMenu.hide();
48+ }
49+ }
50+
51+ Connections {
52+ target: indicatorsMenu
53+ onShown: hideTimer.stop()
54+ }
55+
34 PanelBackground {
56 PanelBackground {
35 id: panelBackground
57 id: panelBackground
36 anchors {
58 anchors {
Shell.qml+4
@@ -576,6 +576,10 @@ FocusScope {
576 stages.hide()
576 stages.hide()
577 }
577 }
578
578
579+ function hideIndicatorMenu(delay) {
580+ panel.hideIndicatorMenu(delay);
581+ }
582+
579 Item {
583 Item {
580 id: overlay
584 id: overlay
581
585
plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml+3
@@ -50,6 +50,7 @@ Indicators.BaseMenuItem {
50
50
51 onActivateApp: {
51 onActivateApp: {
52 menuItem.model.activate(modelIndex, true);
52 menuItem.model.activate(modelIndex, true);
53+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
53 }
54 }
54 onDismiss: {
55 onDismiss: {
55 menuItem.model.activate(modelIndex, false);
56 menuItem.model.activate(modelIndex, false);
@@ -82,6 +83,7 @@ Indicators.BaseMenuItem {
82
83
83 onActivateApp: {
84 onActivateApp: {
84 menuItem.model.activate(modelIndex, true);
85 menuItem.model.activate(modelIndex, true);
86+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
85 }
87 }
86 onDismiss: {
88 onDismiss: {
87 menuItem.model.activate(modelIndex, false);
89 menuItem.model.activate(modelIndex, false);
@@ -125,6 +127,7 @@ Indicators.BaseMenuItem {
125
127
126 onActivateApp: {
128 onActivateApp: {
127 menuItem.model.activate(modelIndex, true);
129 menuItem.model.activate(modelIndex, true);
130+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
128 }
131 }
129 onDismiss: {
132 onDismiss: {
130 menuItem.model.activate(modelIndex, false);
133 menuItem.model.activate(modelIndex, false);
plugins/Unity/Indicators/qml/MenuItemFactory.qml+6
@@ -22,6 +22,7 @@ import Unity.Indicators 0.1 as Indicators
22import Unity.Indicators.Network 0.1 as ICNetwork
22import Unity.Indicators.Network 0.1 as ICNetwork
23import Unity.Indicators.Messaging 0.1 as ICMessaging
23import Unity.Indicators.Messaging 0.1 as ICMessaging
24import QMenuModel 0.1 as QMenuModel
24import QMenuModel 0.1 as QMenuModel
25+import Ubuntu.Components 0.1
25
26
26Item {
27Item {
27 id: menuFactory
28 id: menuFactory
@@ -95,6 +96,7 @@ Item {
95
96
96 onActivate: {
97 onActivate: {
97 model.activate(modelIndex);
98 model.activate(modelIndex);
99+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
98 }
100 }
99 }
101 }
100 }
102 }
@@ -132,6 +134,7 @@ Item {
132
134
133 onActivate: {
135 onActivate: {
134 model.activate(modelIndex);
136 model.activate(modelIndex);
137+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
135 }
138 }
136 }
139 }
137 }
140 }
@@ -148,6 +151,7 @@ Item {
148
151
149 onActivate: {
152 onActivate: {
150 model.activate(modelIndex);
153 model.activate(modelIndex);
154+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
151 }
155 }
152 }
156 }
153 }
157 }
@@ -190,6 +194,7 @@ Item {
190 }
194 }
191 onActivate: {
195 onActivate: {
192 model.activate(modelIndex);
196 model.activate(modelIndex);
197+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
193 }
198 }
194 }
199 }
195 }
200 }
@@ -225,6 +230,7 @@ Item {
225 }
230 }
226 onActivateApp: {
231 onActivateApp: {
227 model.activate(modelIndex, true);
232 model.activate(modelIndex, true);
233+ shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
228 }
234 }
229 onDismiss: {
235 onDismiss: {
230 model.activate(modelIndex, false);
236 model.activate(modelIndex, false);
tests/qmltests/Dash/tst_GenericScopeView.qml+35−5
@@ -99,11 +99,11 @@ Item {
99 categoryListView.positionAtBeginning();
99 categoryListView.positionAtBeginning();
100
100
101 tryCompareFunction(function() {
101 tryCompareFunction(function() {
102− var tile = findChild(genericScopeView, "delegate0");
102+ var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
103 return tile != undefined;
103 return tile != undefined;
104 },
104 },
105 true);
105 true);
106− var tile = findChild(genericScopeView, "delegate0");
106+ var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
107 mouseClick(tile, tile.width / 2, tile.height / 2);
107 mouseClick(tile, tile.width / 2, tile.height / 2);
108 tryCompare(previewListView, "open", true);
108 tryCompare(previewListView, "open", true);
109 tryCompare(openEffect, "gap", 1);
109 tryCompare(openEffect, "gap", 1);
@@ -111,11 +111,11 @@ Item {
111
111
112 function checkArrowPosition(index) {
112 function checkArrowPosition(index) {
113 tryCompareFunction(function() {
113 tryCompareFunction(function() {
114− var tile = findChild(genericScopeView, "delegate" + index);
114+ var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
115 return tile != undefined;
115 return tile != undefined;
116 },
116 },
117 true);
117 true);
118− var tile = findChild(genericScopeView, "delegate" + index);
118+ var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
119 var tileCenter = tile.x + tile.width/2;
119 var tileCenter = tile.x + tile.width/2;
120 var pointerArrow = findChild(previewListView, "pointerArrow");
120 var pointerArrow = findChild(previewListView, "pointerArrow");
121 var pointerArrowCenter = pointerArrow.x + pointerArrow.width/2;
121 var pointerArrowCenter = pointerArrow.x + pointerArrow.width/2;
@@ -167,7 +167,7 @@ Item {
167 categoryListView.flick(0, -units.gu(60));
167 categoryListView.flick(0, -units.gu(60));
168 tryCompare(categoryListView.flicking, false);
168 tryCompare(categoryListView.flicking, false);
169
169
170− var tile = findChild(genericScopeView, "delegate0");
170+ var tile = findChild(findChild(genericScopeView, "0"), "delegate0");
171 mouseClick(tile, tile.width / 2, tile.height - 1);
171 mouseClick(tile, tile.width / 2, tile.height - 1);
172 tryCompare(openEffect, "gap", 1);
172 tryCompare(openEffect, "gap", 1);
173
173
@@ -298,6 +298,36 @@ Item {
298 closePreview();
298 closePreview();
299 tryCompare(previewListView, "open", false);
299 tryCompare(previewListView, "open", false);
300 }
300 }
301+
302+ function test_filter_expand_expand() {
303+ // wait for the item to be there
304+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != undefined; }, true);
305+
306+ var categoryListView = findChild(genericScopeView, "categoryListView");
307+ categoryListView.contentY = categoryListView.height;
308+
309+ var header2 = findChild(genericScopeView, "dashSectionHeader2")
310+ var category2 = findChild(genericScopeView, "dashCategory2")
311+ var category2FilterGrid = category2.children[0].children[0].children[0];
312+ verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
313+
314+ waitForRendering(header2);
315+ verify(category2.expandable);
316+ verify(category2.filtered);
317+
318+ mouseClick(header2, header2.width / 2, header2.height / 2);
319+ tryCompare(category2, "filtered", false);
320+ tryCompare(category2FilterGrid, "filter", false);
321+
322+ categoryListView.positionAtBeginning();
323+
324+ var header0 = findChild(genericScopeView, "dashSectionHeader0")
325+ var category0 = findChild(genericScopeView, "dashCategory0")
326+ mouseClick(header0, header0.width / 2, header0.height / 2);
327+ tryCompare(category0, "filtered", false);
328+ tryCompare(category2, "filtered", true);
329+ tryCompare(category2FilterGrid, "filter", true);
330+ }
301 }
331 }
302 }
332 }
303}
333}
tests/qmltests/Panel/tst_Panel.qml+14
@@ -264,5 +264,19 @@ Item {
264
264
265 compare(indicatorRow.currentItem, indicatorItemFirst, "First indicator should still be the current item");
265 compare(indicatorRow.currentItem, indicatorItemFirst, "First indicator should still be the current item");
266 }
266 }
267+
268+ function test_hideIndicatorMenu_data() {
269+ return [ {tag: "no-delay", delay: undefined },
270+ {tag: "delayed", delay: 200 }
271+ ];
272+ }
273+
274+ function test_hideIndicatorMenu(data) {
275+ panel.indicators.show();
276+ compare(panel.indicators.shown, true);
277+
278+ panel.hideIndicatorMenu(data.delay);
279+ tryCompare(panel.indicators, "shown", false);
280+ }
267 }
281 }
268}
282}