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 Unity.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 requestedApplicationActivation(application)
47 if (terminationModeEnabled) {
48 requestedActivationMode()
50 requestedTerminationMode()
54 function updateScreenshotFromCache() {
55 applicationImage.updateFromCache();
58 // FIXME: should use UbuntuShape from SDK
60 id: shapedApplicationImage
63 horizontalCenter: parent.horizontalCenter
66 // FIXME: width and height should be defined according to the
67 // application window's aspect ratio.
68 width: (application.stage === ApplicationInfo.MainStage && __sideStageEnabled) ?
69 units.gu(22) : units.gu(11)
70 height: (__sideStageEnabled) ? units.gu(22) : units.gu(19)
72 image: applicationImage
77 source: ApplicationManager.findApplication((application) ? application.appId : "")
78 width: shapedApplicationImage.width
79 height: shapedApplicationImage.height
85 anchors.fill: shapedApplicationImage
87 borderSource: "radius_pressed.sci"
88 opacity: root.pressed ? 1.0 : 0.0
89 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
92 // FIXME: label code duplicated with Tile
98 top: shapedApplicationImage.bottom
105 baseline: parent.bottom
109 text: (application) ? application.name : ""
111 color: Theme.palette.selected.backgroundText
116 elide: Text.ElideMiddle
117 horizontalAlignment: Text.AlignHCenter
122 objectName: "closeIcon " + model.name
124 left: shapedApplicationImage.left
125 leftMargin: -units.gu(1)
127 topMargin: -units.gu(1)
132 enabled: root.terminationModeEnabled
135 anchors { fill: parent; margins: -units.gu(1) }
136 onClicked: requestedApplicationTermination(application)
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