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/>.
18import Ubuntu.Components 0.1
23 property string iconName
25 property real angle: 0
26 property bool highlighted: false
27 property real offset: 0
29 property real maxAngle: 0
30 property bool inverted: false
32 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * height
33 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * height
35 property int itemsBeforeThis: 0
36 property int itemsAfterThis: 0
38 property bool dragging:false
46 color: Qt.rgba(0, 0, 1, 0.5)
49 anchors.centerIn: parent
50 anchors.verticalCenterOffset: root.offset + (height - root.effectiveHeight)/2 * (angle < 0 ? -1 : 1)
51 rotation: root.inverted ? 180 : 0
55 axis { x: 1; y: 0; z: 0 }
56 origin { x: iconItem.width / 2; y: iconItem.height / 2; z: 0 }
61 source: "../graphics/applicationIcons/" + root.iconName + ".png"
67 onClicked: root.clicked()
68 onCanceled: root.released()
69 preventStealing: false
81 anchors.centerIn: iconItem
82 rotation: inverted ? 180 : 0
83 source: root.highlighted || mouseArea.pressed ? "graphics/selected.sci" : "graphics/non-selected.sci"
84 width: iconItem.width + units.gu(1.5)
94 offset: if (launcherFlickable.contentY > itemsBeforeThis * (foldedHeight + launcherColumn.spacing*2)) {
95 return launcherFlickable.contentY - (index * (foldedHeight + launcherColumn.spacing*2));
96 } else if (y + height - launcherFlickable.contentY > launcherFlickable.height - (itemsAfterThis*(foldedHeight - launcherColumn.spacing))) {
97 return launcherFlickable.height - (y+height) + launcherFlickable.contentY - (itemsAfterThis*(foldedHeight - launcherColumn.spacing));
101 angle: -Math.min(Math.max(offset * maxAngle / foldedHeight, -maxAngle), maxAngle)
109 target: launcherDelegate;
120 preventStealing: true
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list