18 import Ubuntu.Components 0.1
22 property url mascot:
""
23 property alias title: titleLabel.text
26 property alias titleWeight: titleLabel.font.weight
27 property alias titleSize: titleLabel.fontSize
30 property real fontScale: 1.0
32 property alias headerAlignment: titleLabel.horizontalAlignment
34 property bool inOverlay:
false
35 property bool useMascotShape:
true
36 property color fontColor: Theme.palette.selected.backgroundText
38 visible: mascot !=
"" || title
39 implicitHeight: row.height > 0 ? row.height + row.margins * 2 : 0
43 objectName:
"outerRow"
45 property real margins: units.gu(1)
47 spacing: mascotShapeLoader.active || mascotImageLoader.active || inOverlay ? margins : 0
49 top: parent.top; left: parent.left; right: parent.right
57 objectName:
"mascotShapeLoader"
59 active: useMascotShape && mascotImageLoader.item && mascotImageLoader.item.status === Image.Ready
61 anchors.verticalCenter: parent.verticalCenter
64 height: units.gu(5.625)
65 readonly
property int maxSize: Math.max(width, height) * 4
67 sourceComponent: UbuntuShape {
68 image: mascotImageLoader.item
74 active: root.mascot !=
""
75 visible: active && !useMascotShape && item.status === Image.Ready
76 anchors.verticalCenter: parent.verticalCenter
77 sourceComponent: Image {
78 objectName:
"mascotImage"
81 width: source ? mascotShapeLoader.width : 0
82 height: mascotShapeLoader.height
84 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
85 fillMode: Image.PreserveAspectCrop
86 horizontalAlignment: Image.AlignHCenter
87 verticalAlignment: Image.AlignVCenter
93 width: parent.width - x
95 anchors.verticalCenter: parent.verticalCenter
99 objectName:
"titleLabel"
100 anchors { left: parent.left; right: parent.right }
101 elide: Text.ElideRight
102 font.weight: Font.Normal
106 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
111 active: titleLabel.text && root.subtitle
112 anchors { left: parent.left; right: parent.right }
113 sourceComponent: Label {
115 objectName:
"subtitleLabel"
116 elide: Text.ElideRight
118 font.weight: Font.Light
119 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)