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"
23 import "../Components/Flickables" as Flickables
29 property QtObject indicatorsModel: null
30 readonly property alias currentMenuIndex: listViewHeader.currentIndex
31 color: "#221e1c" // FIXME not in palette yet
32 property real headerHeight: listViewHeader.height
37 function setCurrentMenuIndex(index, animate) {
38 // FIXME - https://bugreports.qt-project.org/browse/QTBUG-41229
39 listViewHeader.currentIndex = -1;
40 listViewHeader.currentIndex = index;
45 objectName: "indicatorsHeaderListView"
46 model: content.indicatorsModel
55 highlightFollowsCurrentItem: true
56 highlightMoveDuration: 0
58 orientation: ListView.Horizontal
59 snapMode: ListView.SnapOneItem
60 highlightRangeMode: ListView.StrictlyEnforceRange
61 boundsBehavior: Flickable.StopAtBounds
62 // Load all the indicator menus (a big number)
63 cacheBuffer: 1073741823
66 width: ListView.view.width
67 height: implicitHeight
69 title: indicatorDelegate.title !== "" ? indicatorDelegate.title : identifier
73 Component.onCompleted: {
74 for(var pName in indicatorProperties) {
75 if (indicatorDelegate.hasOwnProperty(pName)) {
76 indicatorDelegate[pName] = indicatorProperties[pName];
86 objectName: "indicatorsContentListView"
90 top: listViewHeader.bottom
93 model: content.indicatorsModel
96 currentIndex: listViewHeader.currentIndex
98 highlightMoveDuration: 0
99 orientation: ListView.Horizontal
100 // Load all the indicator menus (a big number)
101 cacheBuffer: 1073741823
105 width: ListView.view.width
106 height: ListView.view.height
107 objectName: identifier
113 // Reset the indicator states
114 if (!visible && item && item["reset"]) {
120 for(var pName in indicatorProperties) {
121 if (item.hasOwnProperty(pName)) {
122 item[pName] = indicatorProperties[pName]
129 property: "identifier"
135 property: "objectName"
136 value: identifier + "-page"