@@ -53,91 +53,40 @@ AbstractButton {
5353 Item {
5454 id: thumbnail
5555
56− width: thumbnailHelper.flippedDimensions ? shapedApplicationImage.height : shapedApplicationImage.width
57− height: thumbnailHelper.flippedDimensions ? shapedApplicationImage.width : shapedApplicationImage.height
58−
59− onWidthChanged: {console.log("thumbnail.width = " + width);}
60− onHeightChanged: {console.log("thumbnail.height = " + height);}
61−
62−
63− Item {
64− id: thumbnailHelper
65−
66− property bool flippedDimensions: root.orientationAngle == 90 || root.orientationAngle == 270
67−
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
71− // its UI
72− transformOrigin: Item.TopLeft
73− state: orientationAngle.toString()
74− states: [
75− State {
76− name: "0"
77− PropertyChanges {
78− target: thumbnailHelper
79− rotation: 0
80− x: 0
81− y: 0
82− }
83− },
84− State {
85− name: "90"
86− PropertyChanges {
87− target: thumbnailHelper
88− rotation: -90
89− x: 0
90− y: shapedApplicationImage.width
91− }
92− },
93− State {
94− name: "180"
95− PropertyChanges {
96− target: thumbnailHelper
97− rotation: -180
98− x: shapedApplicationImage.width
99− y: shapedApplicationImage.height
100− }
101− },
102− State {
103− name: "270"
104− PropertyChanges {
105− target: thumbnailHelper
106− rotation: -270
107− x: shapedApplicationImage.height
108− y: 0
109− }
110− }
111− ]
112−
113− UbuntuShape {
114− id: shapedApplicationImage
115− x: 0
116− y: 0
117− height: applicationImage.height
118− width: applicationImage.width
119− radius: "medium"
120−
121− image: Image {
122− id: applicationImage
123− source: application.screenshot
124− // height : width = ss.height : ss.width
125− height: units.gu(17)
126− fillMode: Image.PreserveAspectCrop
127− width: Math.min(height, height * sourceSize.width / sourceSize.height)
128− }
129−
56+ width: shapedApplicationImage.width
57+ height: shapedApplicationImage.height
58+
59+ UbuntuShape {
60+ id: shapedApplicationImage
61+ x: 0
62+ y: 0
63+ height: applicationImage.height
64+ width: applicationImage.width
65+ radius: "medium"
66+
67+ image: Image {
68+ id: applicationImage
69+ source: application.screenshot
70+ // height : width = ss.height : ss.width
71+
72+ property bool isLandscape: sourceSize.width > sourceSize.height
73+ property real maxDimension: units.gu(17)
74+
75+ width: isLandscape ? Math.min(sourceSize.width, maxDimension) : height * (sourceSize.width / sourceSize.height)
76+ height: isLandscape ? width * (sourceSize.height / sourceSize.width) : Math.min(sourceSize.height, maxDimension)
77+ fillMode: Image.PreserveAspectCrop
13078 }
13179
132− UbuntuShape {
133− id: borderPressed
80+ }
81+
82+ UbuntuShape {
83+ id: borderPressed
13484
135− anchors.fill: shapedApplicationImage
136− radius: "medium"
137− borderSource: "radius_pressed.sci"
138− opacity: root.pressed ? 1.0 : 0.0
139− Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
140− }
85+ anchors.fill: shapedApplicationImage
86+ radius: "medium"
87+ borderSource: "radius_pressed.sci"
88+ opacity: root.pressed ? 1.0 : 0.0
89+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
14190 }
14291 }
14392