@@ -14,50 +14,58 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17−import QtQuick 2.0
17+import QtQuick 2.2
18+import Ubuntu.Components 1.1
18−import Ubuntu.Components 0.1
19+import Ubuntu.Components.Themes 0.1
19import "../Components"
20import "../Components"
21−Rectangle {
22+StyledItem {
25 property string name: ""
25 property string name: ""
26 property url image: ""
26 property url image: ""
28− UbuntuShape {
28+ // FIXME: fake a Theme object as to expose the Palette corresponding to the backgroundColor (see MainViewStyle.qml)
29− id: iconShape
29+ property var theme: QtObject {
30− anchors.horizontalCenter: parent.horizontalCenter
30+ property string name
31− anchors.verticalCenter: parent.verticalCenter
31+ property Palette palette: paletteLoader.item
32− anchors.verticalCenterOffset: -units.gu(4)
32+ }
33− width: units.gu(8)
33+
34− height: units.gu(7.5)
34+ Loader {
36+ source: "%1Palette.qml".arg(theme.name)
39+ // mimic API of toolkit's MainView component required by MainViewStyle
40+ property color headerColor: backgroundColor
41+ // FIXME: should be read from desktop file and set by SpreadDelegate
42+ property color backgroundColor: theme.palette.normal.background
43+ property color footerColor: backgroundColor
36− radius: "medium"
45+ // FIXME: should instead use to be created API from toolkit
37− borderSource: "none"
46+ // style: theme.createStyleComponent("MainViewStyle.qml", root)
47+ style: Component { MainViewStyle {theme: root.theme} }
39− image: Image {
49+ StyledItem {
40− id: iconImage
50+ id: header
41− sourceSize.width: iconShape.width
51+ anchors {
42− sourceSize.height: iconShape.height
52+ left: parent.left
43− source: root.image
53+ right: parent.right
44− fillMode: Image.PreserveAspectCrop
48− Label {
56+ // mimic API of toolkit's AppHeader component required by PageHeadStyle
57+ property Item pageStack
58+ property Item contents
49− text: root.name
59+ property string title: root.name
50− anchors.horizontalCenter: parent.horizontalCenter
60+ property var tabsModel
51− anchors.top: iconShape.bottom
61+ property var config: QtObject {
52− anchors.topMargin: units.gu(2)
62+ property color foregroundColor: theme.palette.selected.backgroundText
53− fontSize: "large"
63+ property var sections
56− WaitingDots {
66+ // FIXME: should instead use to be created API from toolkit:
57− visible: parent.visible
67+ // style: theme.createStyleComponent("PageHeadStyle.qml", header)
58− anchors.horizontalCenter: parent.horizontalCenter
68+ style: Component { PageHeadStyle {theme: root.theme} }
59− anchors.bottom: parent.bottom
60− anchors.bottomMargin: units.gu(12)
63 MouseArea {
71 MouseArea {