2 * Copyright (C) 2013-2014 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 Lomiri.Components 1.3
20 import Lomiri.Indicators 0.1 as Indicators
22 import "../Components"
28 property QtObject model: null
29 property int currentMenuIndex: -1
30 property Component pageDelegate
32 color: theme.palette.normal.background
37 onCurrentMenuIndexChanged: {
38 listViewContent.currentIndex = currentMenuIndex;
43 objectName: "indicatorsContentListView"
47 highlightFollowsCurrentItem: false
49 orientation: ListView.Horizontal
50 // Load all the indicator menus (a big number)
51 cacheBuffer: 1073741823
53 // for additions/removals.
55 listViewContent.currentIndex = content.currentMenuIndex;
58 onCurrentIndexChanged: {
59 positionViewAtIndex(currentIndex, ListView.Beginning);
65 width: ListView.view.width
66 height: ListView.view.height
68 visible: ListView.isCurrentItem
70 property var modelData: model
71 property var modelIndex: index
73 sourceComponent: pageDelegate
76 // Reset the indicator states
77 if (!visible && status == Loader.Ready) {