on xenial help sign in
removed content activator
commit2a84c00dad2b80b1613b0525b8c197f89ff0cd72 authorNick Dedekind <nick.dedekind@canonical.com> dateTue 9 Sep 2014, 14:40 (12 years ago) parentaa4043d
3 files changed+3−73
qml/Panel/Indicators.qml−10 qml/Panel/Indicators/DefaultIndicatorPage.qml+3−19 qml/Panel/MenuContent.qml−44
qml/Panel/Indicators.qml−10
@@ -84,10 +84,6 @@ Showable {
8484 indicators.state = "locked";
8585 }
8686 }
87−
88− if (enableRelease && revealProgress === 0) {
89− menuContent.releaseContent();
90− }
9187 }
9288
9389 function calculateCurrentItem(xValue, useBuffer) {
@@ -357,12 +353,6 @@ Showable {
357353 maxTotalDragDistance: openedHeight - panelHeight
358354 distanceThreshold: panelHeight
359355
360− onStatusChanged: {
361− if (status === DirectionalDragArea.Recognized) {
362− menuContent.activateContent();
363− }
364− }
365−
366356 onTapped: showTapped(Qt.point(touchSceneX, touchSceneY));
367357 }
368358
qml/Panel/Indicators/DefaultIndicatorPage.qml+3−19
@@ -26,13 +26,12 @@ IndicatorBase {
2626 id: main
2727
2828 //const
29− property bool contentActive: false
3029 property string title: rootActionState.title
3130 property alias highlightFollowsCurrentItem : mainMenu.highlightFollowsCurrentItem
3231
3332 Indicators.UnityMenuModelStack {
3433 id: menuStack
35− head: contentActive ? main.menuModel : null
34+ head: main.menuModel
3635
3736 property var rootMenu: null
3837
@@ -88,10 +87,11 @@ IndicatorBase {
8887 }
8988
9089 // Ensure all delegates are cached in order to improve smoothness of scrolling
91− cacheBuffer: 10000
90+ cacheBuffer: height * 2
9291
9392 // Only allow flicking if the content doesn't fit on the page
9493 interactive: contentHeight > height
94+ boundsBehavior: Flickable.StopAtBounds
9595
9696 property int selectedIndex: -1
9797 property bool blockCurrentIndexChange: false
@@ -174,24 +174,8 @@ IndicatorBase {
174174 menuModel: mainMenu.model ? mainMenu.model : null
175175 }
176176
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−
192177 function reset()
193178 {
194− mainMenu.selectedIndex = -1;
195179 mainMenu.positionViewAtBeginning();
196180 }
197181}
qml/Panel/MenuContent.qml−44
@@ -26,10 +26,8 @@ Rectangle {
2626 id: content
2727
2828 property QtObject indicatorsModel: null
29− property bool __contentActive: false
3029 readonly property alias currentMenuIndex: listViewHeader.currentIndex
3130 color: "#221e1c" // FIXME not in palette yet
32− property int contentReleaseInterval: 20000
3331 property real headerHeight: listViewHeader.height
3432
3533 width: units.gu(40)
@@ -39,17 +37,6 @@ Rectangle {
3937 listViewHeader.currentIndex = index;
4038 }
4139
42− function activateContent() {
43− contentReleaseTimer.stop();
44− __contentActive = true;
45− }
46−
47− function releaseContent() {
48− if (__contentActive) {
49− contentReleaseTimer.restart();
50− }
51− }
52−
5340 ListView {
5441 id: listViewHeader
5542 objectName: "indicatorsHeaderListView"
@@ -117,17 +104,6 @@ Rectangle {
117104 source: pageSource
118105 asynchronous: true
119106
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−
131107 onVisibleChanged: {
132108 // Reset the indicator states
133109 if (!visible && item && item["reset"]) {
@@ -141,9 +117,6 @@ Rectangle {
141117 item[pName] = indicatorProperties[pName]
142118 }
143119 }
144− if (contentActive && listViewContent.visible) {
145− item.start()
146− }
147120 }
148121
149122 Binding {
@@ -153,21 +126,4 @@ Rectangle {
153126 }
154127 }
155128 }
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− }
173129}