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
56 // FIXME Move to ListItem (and remove import) once 1556971 is fixed
57 delegate: ListItems.Empty {
58 objectName: root.objectName + "child" + index
59 height: root.itemHeight
64 leftMargin: units.gu(2)
65 rightMargin: units.gu(2)
68 onClicked: root.enterNavigation(navigationId, allLabel != "" ? allLabel : label, hasChildren)
73 verticalCenter: parent.verticalCenter
85 verticalCenter: parent.verticalCenter
87 leftMargin: units.gu(1)
89 rightMargin: units.gu(2)
92 color: isActive ? "#333333" : "#888888"
95 elide: Text.ElideMiddle
101 verticalCenter: parent.verticalCenter
110 divider.visible: index != navigation.count - 1