@@ -29,11 +29,11 @@ AbstractButton {
29 signal requestedActivationMode()
29 signal requestedActivationMode()
30 signal requestedTerminationMode()
30 signal requestedTerminationMode()
32− // Was: childrenRect.height
32+ width: thumbnail.width
33− // To avoid "binding loop" warning
34− height: shapedApplicationImage.height + labelContainer.height
33+ height: thumbnail.height + labelContainer.height
36− width: shapedApplicationImage.width <= units.gu(11) ? units.gu(11) : height
35+ // Orientation angle of the Shell UI, relative to the scene (QQuickView's) root item.
36+ property int orientationAngle
38 property bool terminationModeEnabled: false
38 property bool terminationModeEnabled: false
@@ -50,42 +50,104 @@ AbstractButton {
56+ width: thumbnailHelper.flippedDimensions ? shapedApplicationImage.height : shapedApplicationImage.width
57+ height: thumbnailHelper.flippedDimensions ? shapedApplicationImage.width : shapedApplicationImage.height
59+ onWidthChanged: {console.log("thumbnail.width = " + width);}
60+ onHeightChanged: {console.log("thumbnail.height = " + height);}
66+ property bool flippedDimensions: root.orientationAngle == 90 || root.orientationAngle == 270
68+ // Compensate for the UI rotation that is done by the application itself
69+ // TODO: Only counter-rotate if the application UI is rotated in the first place
70+ // Currently we don't have this info, so we just assume every single app rotate
72+ transformOrigin: Item.TopLeft
73+ state: orientationAngle.toString()
78+ target: thumbnailHelper
87+ target: thumbnailHelper
90+ y: shapedApplicationImage.width
96+ target: thumbnailHelper
98+ x: shapedApplicationImage.width
99+ y: shapedApplicationImage.height
105+ target: thumbnailHelper
107+ x: shapedApplicationImage.height
53− UbuntuShape {
113+ UbuntuShape {
54− id: shapedApplicationImage
114+ id: shapedApplicationImage
55− anchors { top: parent.top; horizontalCenter: parent.horizontalCenter }
115+ x: 0
57− height: units.gu(17)
117+ height: applicationImage.height
58− width: applicationImage.width
118+ width: applicationImage.width
59− radius: "medium"
119+ radius: "medium"
61− image: Image {
121+ image: Image {
62− id: applicationImage
122+ id: applicationImage
63− source: application.screenshot
123+ source: application.screenshot
64− // height : width = ss.height : ss.width
124+ // height : width = ss.height : ss.width
65− height: shapedApplicationImage.height
125+ height: units.gu(17)
66− fillMode: Image.PreserveAspectCrop
126+ fillMode: Image.PreserveAspectCrop
67− width: Math.min(height, height * sourceSize.width / sourceSize.height)
127+ width: Math.min(height, height * sourceSize.width / sourceSize.height)
72− UbuntuShape {
132+ UbuntuShape {
73− id: borderPressed
133+ id: borderPressed
75− anchors.fill: shapedApplicationImage
135+ anchors.fill: shapedApplicationImage
76− radius: "medium"
136+ radius: "medium"
77− borderSource: "radius_pressed.sci"
137+ borderSource: "radius_pressed.sci"
78− opacity: root.pressed ? 1.0 : 0.0
138+ opacity: root.pressed ? 1.0 : 0.0
79− Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
139+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
82 // FIXME: label code duplicated with Tile
144 // FIXME: label code duplicated with Tile
84 id: labelContainer
146 id: labelContainer
85 anchors {
147 anchors {
86− left: parent.left
148+ left: thumbnail.left
87− right: parent.right
149+ right: thumbnail.right
88− top: shapedApplicationImage.bottom
150+ top: thumbnail.bottom
90 height: units.gu(2)
152 height: units.gu(2)
@@ -110,9 +172,9 @@ AbstractButton {
110 CloseIcon {
172 CloseIcon {
111 objectName: "closeIcon " + model.name
173 objectName: "closeIcon " + model.name
112 anchors {
174 anchors {
113− left: shapedApplicationImage.left
175+ left: thumbnail.left
114 leftMargin: -units.gu(1)
176 leftMargin: -units.gu(1)
115− top: parent.top
177+ top: thumbnail.top
116 topMargin: -units.gu(1)
178 topMargin: -units.gu(1)
118 height: units.gu(6)
180 height: units.gu(6)