18 import Ubuntu.Components 0.1
30 height: childrenRect.height
34 objectName:
"innerPreviewHeader"
35 readonly
property url mascot: root.widgetData[
"mascot"] ||
""
36 readonly
property string title: root.widgetData[
"title"] ||
""
37 readonly
property string subtitle: root.widgetData[
"subtitle"] ||
""
38 readonly
property color fontColor: root.scopeStyle ? root.scopeStyle.foreground :
"grey"
40 implicitHeight: row.height + row.margins * 2
45 objectName:
"outerRow"
47 property real margins: units.gu(1)
49 spacing: mascotShapeLoader.active ? margins : 0
51 top: parent.top; left: parent.left; right: parent.right
59 objectName:
"mascotShapeLoader"
60 active: headerRoot.mascot !=
""
63 anchors.verticalCenter: parent.verticalCenter
66 height: units.gu(5.625)
67 readonly
property int maxSize: Math.max(width, height) * 4
70 sourceComponent: UbuntuShape {
71 objectName:
"mascotShape"
72 visible: image.status === Image.Ready
74 source: headerRoot.mascot
75 width: source ? mascotShapeLoader.width : 0
76 height: mascotShapeLoader.height
78 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
79 fillMode: Image.PreserveAspectCrop
80 horizontalAlignment: Image.AlignHCenter
81 verticalAlignment: Image.AlignVCenter
88 width: parent.width - x
90 anchors.verticalCenter: parent.verticalCenter
94 objectName:
"titleLabel"
95 anchors { left: parent.left; right: parent.right }
96 elide: Text.ElideRight
97 font.weight: Font.Normal
101 color: headerRoot.fontColor
102 text: headerRoot.title
106 active: titleLabel.text && headerRoot.subtitle
107 anchors { left: parent.left; right: parent.right }
108 sourceComponent: Label {
110 objectName:
"subtitleLabel"
111 elide: Text.ElideRight
113 font.weight: Font.Light
114 color: headerRoot.fontColor
115 text: headerRoot.subtitle