2 * Copyright (C) 2014,2015 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 Ubuntu.Components 1.3
19 import Ubuntu.Components.ListItems 1.3 as ListItems
20 import "../Components"
24 property var navigation: null
25 property var currentNavigation: null
26 signal enterNavigation(var newNavigationId, string newNavigationLabel, bool hasChildren)
28 readonly property int itemHeight: units.gu(5)
29 implicitHeight: flickable.contentHeight
34 UbuntuNumberAnimation {
36 duration: UbuntuAnimation.SnapDuration
45 flickableDirection: Flickable.VerticalFlick
46 contentHeight: column.height
54 model: navigation && navigation.loaded ? navigation : null
58 height: root.itemHeight
60 // FIXME Move to ListItem (and remove import) once 1556971 is fixed
61 sourceComponent: ListItems.Empty {
62 objectName: root.objectName + "child" + index
66 leftMargin: units.gu(2)
67 rightMargin: units.gu(2)
70 onClicked: root.enterNavigation(navigationId, allLabel != "" ? allLabel : label, hasChildren)
75 verticalCenter: parent.verticalCenter
87 verticalCenter: parent.verticalCenter
89 leftMargin: units.gu(1)
91 rightMargin: units.gu(2)
94 color: isActive ? "#333333" : "#888888"
97 elide: Text.ElideMiddle
103 verticalCenter: parent.verticalCenter
112 divider.visible: index != navigation.count - 1