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 Ubuntu.Components 0.1
25
property alias currentIndex: row.currentIndex
27
property int lineHeight: units.dp(2)
28
property int itemSize: units.gu(7)
29
property int iconSize: units.gu(2.5)
31
signal itemSelected(int index)
36
function startNavigation() {
41
function stopNavigation() {
45
function finishNavigation() {
54
onTriggered: finishNavigation()
62
locked: true // TODO: remove this when lp bug #1179569 will be fixed
72
orientation: ListView.Horizontal
73
width: Math.min(Math.max(dashBar.width/2, units.gu(40)), count * itemSize)
75
anchors.horizontalCenter: parent.horizontalCenter
76
onMovingChanged: if (moving) { timeout.stop() } else { timeout.restart() }
77
interactive: visibleArea.widthRatio < 1 && panel.opened
78
highlightFollowsCurrentItem: false
80
onCurrentItemChanged: {
81
highlightLine.width = currentItem.width
82
highlightLine.x = x + currentItem.x
90
height: dashBar.height
91
anchors.top: parent.top
94
dashBar.itemSelected(index)
99
anchors.centerIn: parent
100
/* FIXME: should be 'source: lens.iconHint' but the
101
lenses do not contain the right icons yet
103
source: "graphics/lensIcons/%1.png".arg(lens.name)
106
// opacity: index == currentIndex ? 1 : 1 // same opacity for now
118
bottom: parent.bottom
120
height: dashBar.lineHeight
126
height: parent.height
127
anchors.bottom: parent.bottom
130
Behavior on x {NumberAnimation { duration: 150; easing.type: Easing.OutCubic}}
131
Behavior on width {NumberAnimation { duration: 150; easing.type: Easing.OutCubic}}