@@ -53,91 +53,40 @@ AbstractButton {
54 id: thumbnail
54 id: thumbnail
56− width: thumbnailHelper.flippedDimensions ? shapedApplicationImage.height : shapedApplicationImage.width
56+ width: shapedApplicationImage.width
57− height: thumbnailHelper.flippedDimensions ? shapedApplicationImage.width : shapedApplicationImage.height
57+ height: 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
113− UbuntuShape {
59+ UbuntuShape {
114− id: shapedApplicationImage
60+ id: shapedApplicationImage
117− height: applicationImage.height
63+ height: applicationImage.height
118− width: applicationImage.width
64+ width: applicationImage.width
119− radius: "medium"
65+ radius: "medium"
121− image: Image {
67+ image: Image {
122− id: applicationImage
68+ id: applicationImage
123− source: application.screenshot
69+ source: application.screenshot
124− // height : width = ss.height : ss.width
70+ // height : width = ss.height : ss.width
125− height: units.gu(17)
71+
72+ property bool isLandscape: sourceSize.width > sourceSize.height
73+ property real maxDimension: units.gu(17)
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)
126− fillMode: Image.PreserveAspectCrop
77+ fillMode: Image.PreserveAspectCrop
127− width: Math.min(height, height * sourceSize.width / sourceSize.height)
132− UbuntuShape {
82+ UbuntuShape {
133− id: borderPressed
83+ id: borderPressed
135− anchors.fill: shapedApplicationImage
85+ anchors.fill: shapedApplicationImage
136− radius: "medium"
86+ radius: "medium"
137− borderSource: "radius_pressed.sci"
87+ borderSource: "radius_pressed.sci"
138− opacity: root.pressed ? 1.0 : 0.0
88+ opacity: root.pressed ? 1.0 : 0.0
139− Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
89+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }