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