@@ -1,5 +1,5 @@
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2012 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -13,51 +13,60 @@
13 * You should have received a copy of the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
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/>.
16−import QtQuick 2.0
16+import QtQuick 2.4
17import Ubuntu.Components 1.3
17import Ubuntu.Components 1.3
19// FIXME: copied with slight modifications from Ubuntu UI Toolkit's Ambiance's theme
19// FIXME: copied with slight modifications from Ubuntu UI Toolkit's Ambiance's theme
21− // styling properties
22 anchors.fill: parent
21 anchors.fill: parent
24 id: mainViewStyle
23 id: mainViewStyle
28+ Color of the header's background.
30+ \sa backgroundColor, footerColor
32+ property color headerColor: styledItem.headerColor
27− The background texture of the main view. The image will be drawn over the background color,
35+ Color of the background.
28− so if it has (semi-)transparent pixels, in those pixels the background color will be visible.
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.
40+ \sa footerColor, headerColor
30− property url backgroundSource: "graphics/background_paper.png"
42+ property color backgroundColor: styledItem.backgroundColor
31− property var theme
43+
45+ Color of the footer's background.
47+ \sa backgroundColor, headerColor
49+ property color footerColor: styledItem.footerColor
33 Gradient {
51 Gradient {
34 id: backgroundGradient
52 id: backgroundGradient
35− GradientStop { position: 0.0; color: styledItem.headerColor }
53+ GradientStop { position: 0.0; color: mainViewStyle.headerColor }
36− GradientStop { position: 0.83; color: styledItem.backgroundColor }
54+ GradientStop { position: 0.83; color: mainViewStyle.backgroundColor }
37− GradientStop { position: 1.0; color: styledItem.footerColor }
55+ GradientStop { position: 1.0; color: mainViewStyle.footerColor }
40 Rectangle {
58 Rectangle {
41 id: backgroundColor
59 id: backgroundColor
42 anchors.fill: parent
60 anchors.fill: parent
43− color: styledItem.backgroundColor
61+ color: mainViewStyle.backgroundColor
44 gradient: internals.isGradient ? backgroundGradient : null
62 gradient: internals.isGradient ? backgroundGradient : null
48− id: backgroundTexture
50− source: mainViewStyle.theme.name === "Ambiance" ? mainViewStyle.backgroundSource : ""
54− visible: status === Image.Ready
57 QtObject {
65 QtObject {
58 id: internals
66 id: internals
59− property bool isGradient: styledItem.backgroundColor != styledItem.headerColor ||
67+ property bool isGradient: mainViewStyle.backgroundColor != mainViewStyle.headerColor ||
60− styledItem.backgroundColor != styledItem.footerColor
68+ mainViewStyle.backgroundColor != mainViewStyle.footerColor
62 As we don't know the order the property bindings and onXXXChanged signals are evaluated
71 As we don't know the order the property bindings and onXXXChanged signals are evaluated
63 we should rely only on one property when changing the theme to avoid intermediate
72 we should rely only on one property when changing the theme to avoid intermediate