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
19import Ubuntu.Application 0.1
20import "../../Components/"
21import "../../Components/ListItems"
25 property var application
26 property bool __sideStageEnabled: shell.applicationManager.sideStageEnabled
28 signal requestedApplicationActivation(var application)
29 signal requestedApplicationTermination(var application)
30 signal requestedActivationMode()
31 signal requestedTerminationMode()
33 // Was: childrenRect.height
34 // To avoid "binding loop" warning
35 height: shapedApplicationImage.height + labelContainer.height
37 width: shapedApplicationImage.width
39 property bool terminationModeEnabled: false
42 if (terminationModeEnabled)
43 requestedApplicationTermination(application)
45 requestedApplicationActivation(application)
49 if (terminationModeEnabled) {
50 requestedActivationMode()
52 requestedTerminationMode()
56 function updateScreenshotFromCache() {
57 applicationImage.updateFromCache();
60 // FIXME: should use UbuntuShape from SDK
62 id: shapedApplicationImage
65 horizontalCenter: parent.horizontalCenter
68 // FIXME: width and height should be defined according to the
69 // application window's aspect ratio.
70 width: (application.stage === ApplicationInfo.MainStage && __sideStageEnabled) ?
71 units.gu(22) : units.gu(11)
72 height: (__sideStageEnabled) ? units.gu(22) : units.gu(19)
74 image: applicationImage
80 width: shapedApplicationImage.width
81 height: shapedApplicationImage.height
82 fillMode: ApplicationImage.PreserveAspectCrop
88 anchors.fill: shapedApplicationImage
90 borderSource: "radius_pressed.sci"
91 opacity: root.pressed ? 1.0 : 0.0
92 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
95 // FIXME: label code duplicated with Tile
101 top: shapedApplicationImage.bottom
108 baseline: parent.bottom
111 leftMargin: units.gu(1)
112 rightMargin: units.gu(1)
114 text: (application) ? application.name : ""
116 color: Theme.palette.selected.backgroundText
121 elide: Text.ElideMiddle
122 horizontalAlignment: Text.AlignHCenter
128 right: shapedApplicationImage.right
129 rightMargin: -units.gu(1)
131 topMargin: -units.gu(1)
136 enabled: root.terminationModeEnabled
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