@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2012 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -13,51 +13,60 @@
1313 * You should have received a copy of the GNU Lesser General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
16−import QtQuick 2.0
16+import QtQuick 2.4
1717import Ubuntu.Components 1.3
1818
1919// FIXME: copied with slight modifications from Ubuntu UI Toolkit's Ambiance's theme
2020Item {
21− // styling properties
2221 anchors.fill: parent
2322 z: -1
2423 id: mainViewStyle
2524
25+ property var theme
26+
27+ /*!
28+ Color of the header's background.
29+
30+ \sa backgroundColor, footerColor
31+ */
32+ property color headerColor: styledItem.headerColor
33+
2634 /*!
27− The background texture of the main view. The image will be drawn over the background color,
28− so if it has (semi-)transparent pixels, in those pixels the background color will be visible.
29− */
30− property url backgroundSource: "graphics/background_paper.png"
31− property var theme
35+ Color of the background.
36+
37+ The background is usually a single color. However if \l headerColor
38+ or \l footerColor are set then a gradient of colors will be drawn.
39+
40+ \sa footerColor, headerColor
41+ */
42+ property color backgroundColor: styledItem.backgroundColor
43+
44+ /*!
45+ Color of the footer's background.
46+
47+ \sa backgroundColor, headerColor
48+ */
49+ property color footerColor: styledItem.footerColor
3250
3351 Gradient {
3452 id: backgroundGradient
35− GradientStop { position: 0.0; color: styledItem.headerColor }
36− GradientStop { position: 0.83; color: styledItem.backgroundColor }
37− GradientStop { position: 1.0; color: styledItem.footerColor }
53+ GradientStop { position: 0.0; color: mainViewStyle.headerColor }
54+ GradientStop { position: 0.83; color: mainViewStyle.backgroundColor }
55+ GradientStop { position: 1.0; color: mainViewStyle.footerColor }
3856 }
3957
4058 Rectangle {
4159 id: backgroundColor
4260 anchors.fill: parent
43− color: styledItem.backgroundColor
61+ color: mainViewStyle.backgroundColor
4462 gradient: internals.isGradient ? backgroundGradient : null
4563 }
4664
47− Image {
48− id: backgroundTexture
49− anchors.fill: parent
50− source: mainViewStyle.theme.name === "Ambiance" ? mainViewStyle.backgroundSource : ""
51− fillMode: Image.Tile
52− asynchronous: true
53− cache: false
54− visible: status === Image.Ready
55− }
56−
5765 QtObject {
5866 id: internals
59− property bool isGradient: styledItem.backgroundColor != styledItem.headerColor ||
60− styledItem.backgroundColor != styledItem.footerColor
67+ property bool isGradient: mainViewStyle.backgroundColor != mainViewStyle.headerColor ||
68+ mainViewStyle.backgroundColor != mainViewStyle.footerColor
69+
6170 /*
6271 As we don't know the order the property bindings and onXXXChanged signals are evaluated
6372 we should rely only on one property when changing the theme to avoid intermediate