on xenial help sign in
removed content activator
2a84c00Nick Dedekind
qml/Panel/Indicators.qml−10
@@ -84,10 +84,6 @@ Showable {
84 indicators.state = "locked";
84 indicators.state = "locked";
85 }
85 }
86 }
86 }
87−
88− if (enableRelease && revealProgress === 0) {
89− menuContent.releaseContent();
90− }
91 }
87 }
92
88
93 function calculateCurrentItem(xValue, useBuffer) {
89 function calculateCurrentItem(xValue, useBuffer) {
@@ -357,12 +353,6 @@ Showable {
357 maxTotalDragDistance: openedHeight - panelHeight
353 maxTotalDragDistance: openedHeight - panelHeight
358 distanceThreshold: panelHeight
354 distanceThreshold: panelHeight
359
355
360− onStatusChanged: {
361− if (status === DirectionalDragArea.Recognized) {
362− menuContent.activateContent();
363− }
364− }
365−
366 onTapped: showTapped(Qt.point(touchSceneX, touchSceneY));
356 onTapped: showTapped(Qt.point(touchSceneX, touchSceneY));
367 }
357 }
368
358
qml/Panel/Indicators/DefaultIndicatorPage.qml+3−19
@@ -26,13 +26,12 @@ IndicatorBase {
26 id: main
26 id: main
27
27
28 //const
28 //const
29− property bool contentActive: false
30 property string title: rootActionState.title
29 property string title: rootActionState.title
31 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
30 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
32
31
33 Indicators.UnityMenuModelStack {
32 Indicators.UnityMenuModelStack {
34 id: menuStack
33 id: menuStack
35− head: contentActive ? main.menuModel : null
34+ head: main.menuModel
36
35
37 property var rootMenu: null
36 property var rootMenu: null
38
37
@@ -88,10 +87,11 @@ IndicatorBase {
88 }
87 }
89
88
90 // Ensure all delegates are cached in order to improve smoothness of scrolling
89 // Ensure all delegates are cached in order to improve smoothness of scrolling
91− cacheBuffer: 10000
90+ cacheBuffer: height * 2
92
91
93 // Only allow flicking if the content doesn't fit on the page
92 // Only allow flicking if the content doesn't fit on the page
94 interactive: contentHeight > height
93 interactive: contentHeight > height
94+ boundsBehavior: Flickable.StopAtBounds
95
95
96 property int selectedIndex: -1
96 property int selectedIndex: -1
97 property bool blockCurrentIndexChange: false
97 property bool blockCurrentIndexChange: false
@@ -174,24 +174,8 @@ IndicatorBase {
174 menuModel: mainMenu.model ? mainMenu.model : null
174 menuModel: mainMenu.model ? mainMenu.model : null
175 }
175 }
176
176
177− function start()
178− {
179− reset()
180− if (!contentActive) {
181− contentActive = true;
182− }
183− }
184−
185− function stop()
186− {
187− if (contentActive) {
188− contentActive = false;
189− }
190− }
191−
192 function reset()
177 function reset()
193 {
178 {
194− mainMenu.selectedIndex = -1;
195 mainMenu.positionViewAtBeginning();
179 mainMenu.positionViewAtBeginning();
196 }
180 }
197}
181}
qml/Panel/MenuContent.qml−44
@@ -26,10 +26,8 @@ Rectangle {
26 id: content
26 id: content
27
27
28 property QtObject indicatorsModel: null
28 property QtObject indicatorsModel: null
29− property bool __contentActive: false
30 readonly property alias currentMenuIndex: listViewHeader.currentIndex
29 readonly property alias currentMenuIndex: listViewHeader.currentIndex
31 color: "#221e1c" // FIXME not in palette yet
30 color: "#221e1c" // FIXME not in palette yet
32− property int contentReleaseInterval: 20000
33 property real headerHeight: listViewHeader.height
31 property real headerHeight: listViewHeader.height
34
32
35 width: units.gu(40)
33 width: units.gu(40)
@@ -39,17 +37,6 @@ Rectangle {
39 listViewHeader.currentIndex = index;
37 listViewHeader.currentIndex = index;
40 }
38 }
41
39
42− function activateContent() {
43− contentReleaseTimer.stop();
44− __contentActive = true;
45− }
46−
47− function releaseContent() {
48− if (__contentActive) {
49− contentReleaseTimer.restart();
50− }
51− }
52−
53 ListView {
40 ListView {
54 id: listViewHeader
41 id: listViewHeader
55 objectName: "indicatorsHeaderListView"
42 objectName: "indicatorsHeaderListView"
@@ -117,17 +104,6 @@ Rectangle {
117 source: pageSource
104 source: pageSource
118 asynchronous: true
105 asynchronous: true
119
106
120− readonly property bool indexActive: index >= 0 && index < menuActivator.count && menuActivator.content[index].active
121− readonly property bool contentActive: content.__contentActive && indexActive
122−
123− onContentActiveChanged: {
124− if (contentActive && item) {
125− item.start()
126− } else if (!contentActive && item) {
127− item.stop()
128− }
129− }
130−
131 onVisibleChanged: {
107 onVisibleChanged: {
132 // Reset the indicator states
108 // Reset the indicator states
133 if (!visible && item && item["reset"]) {
109 if (!visible && item && item["reset"]) {
@@ -141,9 +117,6 @@ Rectangle {
141 item[pName] = indicatorProperties[pName]
117 item[pName] = indicatorProperties[pName]
142 }
118 }
143 }
119 }
144− if (contentActive && listViewContent.visible) {
145− item.start()
146− }
147 }
120 }
148
121
149 Binding {
122 Binding {
@@ -153,21 +126,4 @@ Rectangle {
153 }
126 }
154 }
127 }
155 }
128 }
156−
157− Timer {
158− id: contentReleaseTimer
159−
160− interval: contentReleaseInterval
161− onTriggered: {
162− content.__contentActive = false;
163− menuActivator.clear();
164− }
165− }
166−
167− Indicators.MenuContentActivator {
168− id: menuActivator
169− running: content.__contentActive
170− baseIndex: content.currentMenuIndex
171− count: indicatorsModel.count
172− }
173}
129}