~aacid/unity8/dash_overview

« back to all changes in this revision

Viewing changes to tests/plugins/Dash/cardcreator/6.res

  • Committer: Albert Astals
  • Date: 2014-08-07 15:27:32 UTC
  • mfrom: (1155.1.29 do_merged)
  • Revision ID: albert.astals@canonical.com-20140807152732-0zf22298f1lsxrz8
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
                            visible: image.status == Image.Ready;
34
34
                            readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
35
35
                            readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
36
 
                            readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
37
36
                            Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
38
 
                            onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
39
37
                            Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
40
38
                            function updateWidthHeightBindings() {
41
39
                                if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
42
40
                                            width = root.fixedArtShapeSize.width;
43
41
                                            height = root.fixedArtShapeSize.height;
44
 
                                } else if (aspectSmallerThanImageAspect) {
 
42
                                } else {
45
43
                                    width = Qt.binding(function() { return !visible ? 0 : image.width });
46
 
                                    height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect });
47
 
                                } else {
48
 
                                    width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect });
49
44
                                    height = Qt.binding(function() { return !visible ? 0 : image.height });
50
45
                                }
51
46
                            }
54
49
                                source: cardData && cardData["art"] || "";
55
50
                                cache: true;
56
51
                                asynchronous: root.asynchronous;
57
 
                                fillMode: components && components["art"]["fill-mode"] === "fit" ? Image.PreserveAspectFit: Image.PreserveAspectCrop;
58
 
                                readonly property real aspect: implicitWidth / implicitHeight;
 
52
                                fillMode: Image.PreserveAspectCrop;
59
53
                                width: root.width;
60
54
                                height: width / artShape.aspect;
61
55
                            }
63
57
                    }
64
58
                }
65
59
readonly property int headerHeight: 0;
 
60
UbuntuShape {
 
61
    id: touchdown;
 
62
    objectName: "touchdown";
 
63
    anchors { fill: artShapeHolder }
 
64
    visible: root.pressed;
 
65
    radius: "medium";
 
66
    borderSource: "radius_pressed.sci"
 
67
}
66
68
implicitHeight: artShapeHolder.height;
67
69
}