on xenial help sign in
CardHeader mascot improvements.
717bc2aMichał Karnicki
qml/Dash/CardHeader.qml+9−3
@@ -40,13 +40,19 @@ Item {
40 id: mascotShape
40 id: mascotShape
41 objectName: "mascotShape"
41 objectName: "mascotShape"
42
42
43+ // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
43− width: units.gu(8)
44+ width: units.gu(6)
44− height: units.gu(8)
45+ height: units.gu(5.625)
45 visible: image.status === Image.Ready
46 visible: image.status === Image.Ready
47+ readonly property int maxSize: Math.max(width, height)
46
48
47 image: Image {
49 image: Image {
48 id: mascotImage
50 id: mascotImage
51+
49− sourceSize { width: mascotShape.width; height: mascotShape.height }
52+ sourceSize { width: mascotShape.maxSize; height: mascotShape.maxSize }
53+ fillMode: Image.PreserveAspectCrop
54+ horizontalAlignment: Image.AlignHCenter
55+ verticalAlignment: Image.AlignVCenter
50 }
56 }
51 }
57 }
52
58