@@ -1,3 +1,19 @@
2+ * Copyright (C) 2016 Canonical, Ltd.
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1import QtQuick 2.4
17import QtQuick 2.4
2import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
3import "MathUtils.js" as MathUtils
19import "MathUtils.js" as MathUtils
@@ -92,8 +108,6 @@ Item {
92 elide: Qt.ElideMiddle
108 elide: Qt.ElideMiddle
93 anchors.horizontalCenter: parent.horizontalCenter
109 anchors.horizontalCenter: parent.horizontalCenter
94 y: windowTitleTopMargin
110 y: windowTitleTopMargin
95−// //y: priv.spreadTopMargin + priv.contentTopMargin + settings.spreadOffset + settings.titleOffset - height - (priv.contentTopMargin - height) / 4
96−// visible: height < priv.contentTopMargin
97 readonly property var highlightedSurface: root.model ? root.model.surfaceAt(root.highlightedIndex) : null
111 readonly property var highlightedSurface: root.model ? root.model.surfaceAt(root.highlightedIndex) : null
98 readonly property var highlightedApp: root.model ? root.model.applicationAt(root.highlightedIndex) : null
112 readonly property var highlightedApp: root.model ? root.model.applicationAt(root.highlightedIndex) : null
99 text: root.highlightedIndex >= 0 && highlightedSurface && highlightedSurface.name != "" ? highlightedSurface.name :
113 text: root.highlightedIndex >= 0 && highlightedSurface && highlightedSurface.name != "" ? highlightedSurface.name :
@@ -135,10 +149,6 @@ Item {
136 highlightedIndex = (highlightedIndex + 1) % totalItemCount;
150 highlightedIndex = (highlightedIndex + 1) % totalItemCount;
137 spreadFlickable.snap(highlightedIndex)
151 spreadFlickable.snap(highlightedIndex)
138−// var newContentX = (spreadTotalWidth / (totalItemCount + 1)) * Math.max(0, Math.min(totalItemCount - visibleItemCount, highlightedIndex - 1));
139−// if (spreadFlickable.contentX < newContentX || highlightedIndex == 0) {
140−// spreadFlickable.snap(newContentX);
144 function selectPrevious(isAutoRepeat) {
154 function selectPrevious(isAutoRepeat) {
@@ -148,9 +158,5 @@ Item {
149 highlightedIndex = highlightedIndex - 1 >= 0 ? highlightedIndex - 1 : totalItemCount - 1;
159 highlightedIndex = highlightedIndex - 1 >= 0 ? highlightedIndex - 1 : totalItemCount - 1;
150 spreadFlickable.snap(highlightedIndex)
160 spreadFlickable.snap(highlightedIndex)
151−// var newContentX = (spreadFlickable.contentWidth / (totalItemCount + 1)) * Math.max(0, Math.min(totalItemCount - visibleItemCount, highlightedIndex - 1));
152−// if (spreadFlickable.contentX > newContentX || highlightedIndex == totalItemCount - 1) {
153−// spreadFlickable.snap(newContentX)