2 * Copyright (C) 2013 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/>.
18 import QtQuick.Layouts 1.1
19 import Ubuntu.Components 1.1
20 import Unity.Indicators 0.1 as Indicators
22 import "../Components"
28 property QtObject indicatorsModel: null
29 readonly property alias currentMenuIndex: listViewHeader.currentIndex
30 color: "#221e1c" // FIXME not in palette yet
31 property real headerHeight: listViewHeader.height
36 function setCurrentMenuIndex(index, animate) {
37 // FIXME - https://bugreports.qt-project.org/browse/QTBUG-41229
38 listViewHeader.currentIndex = -1;
39 listViewHeader.currentIndex = index;
44 objectName: "indicatorsHeaderListView"
45 model: content.indicatorsModel
54 highlightFollowsCurrentItem: true
55 highlightMoveDuration: 0
57 orientation: ListView.Horizontal
58 snapMode: ListView.SnapOneItem
59 highlightRangeMode: ListView.StrictlyEnforceRange
60 boundsBehavior: Flickable.StopAtBounds
61 // Load all the indicator menus (a big number)
62 cacheBuffer: 1073741823
65 width: ListView.view.width
66 height: implicitHeight
68 title: indicatorDelegate.title !== "" ? indicatorDelegate.title : identifier
72 Component.onCompleted: {
73 for(var pName in indicatorProperties) {
74 if (indicatorDelegate.hasOwnProperty(pName)) {
75 indicatorDelegate[pName] = indicatorProperties[pName];
85 objectName: "indicatorsContentListView"
89 top: listViewHeader.bottom
92 model: content.indicatorsModel
95 currentIndex: listViewHeader.currentIndex
97 highlightMoveDuration: 0
98 orientation: ListView.Horizontal
99 // Load all the indicator menus (a big number)
100 cacheBuffer: 1073741823
104 width: ListView.view.width
105 height: ListView.view.height
106 objectName: identifier
112 // Reset the indicator states
113 if (!visible && item && item["reset"]) {
119 for(var pName in indicatorProperties) {
120 if (item.hasOwnProperty(pName)) {
121 item[pName] = indicatorProperties[pName]
128 property: "identifier"
134 property: "objectName"
135 value: identifier + "-page"