| 1 |
/* |
| 2 |
* Copyright 2012 Canonical Ltd. |
| 3 |
* |
| 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 |
| 6 |
* the Free Software Foundation; version 3. |
| 7 |
* |
| 8 |
* This program is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
* GNU Lesser General Public License for more details. |
| 12 |
* |
| 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/>. |
| 15 |
*/ |
| 16 |
import QtQuick 2.4 |
| 17 |
import Lomiri.Components 1.3 |
| 18 |
|
| 19 |
Item { |
| 20 |
anchors.fill: parent |
| 21 |
z: -1 |
| 22 |
id: mainViewStyle |
| 23 |
|
| 24 |
/*! |
| 25 |
\deprecated |
| 26 |
Color of the header's background. |
| 27 |
|
| 28 |
\sa backgroundColor, footerColor |
| 29 |
*/ |
| 30 |
property color headerColor: styledItem.headerColor |
| 31 |
|
| 32 |
/*! |
| 33 |
Color of the background. |
| 34 |
|
| 35 |
The background is usually a single color. However if \l headerColor |
| 36 |
or \l footerColor are set then a gradient of colors will be drawn. |
| 37 |
|
| 38 |
\sa footerColor, headerColor |
| 39 |
*/ |
| 40 |
property color backgroundColor: styledItem.backgroundColor |
| 41 |
|
| 42 |
/*! |
| 43 |
\deprecated |
| 44 |
Color of the footer's background. |
| 45 |
|
| 46 |
\sa backgroundColor, headerColor |
| 47 |
*/ |
| 48 |
property color footerColor: styledItem.footerColor |
| 49 |
|
| 50 |
Rectangle { |
| 51 |
anchors.fill: parent |
| 52 |
// Hide the gradient if the style was loaded and afterwards the header |
| 53 |
// and footer color are set to the same value as backgroundColor. |
| 54 |
visible: mainViewStyle.backgroundColor != mainViewStyle.headerColor || |
| 55 |
mainViewStyle.backgroundColor != mainViewStyle.footerColor |
| 56 |
gradient: Gradient { |
| 57 |
GradientStop { position: 0.0; color: mainViewStyle.headerColor } |
| 58 |
GradientStop { position: 0.83; color: mainViewStyle.backgroundColor } |
| 59 |
GradientStop { position: 1.0; color: mainViewStyle.footerColor } |
| 60 |
} |
| 61 |
} |
| 62 |
} |