| 1 |
/* |
| 2 |
* Copyright 2014 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 |
|
| 18 |
Item { |
| 19 |
id: dividerStyle |
| 20 |
|
| 21 |
property color color: styledItem.backgroundColor |
| 22 |
|
| 23 |
// Do not make the following two colors part of the style API as they may be deprecated soon. |
| 24 |
property color topColor: Qt.darker(color, 1.1) |
| 25 |
property color bottomColor: Qt.lighter(color, 1.2) |
| 26 |
|
| 27 |
Rectangle { |
| 28 |
anchors.fill: parent |
| 29 |
color: dividerStyle.color |
| 30 |
|
| 31 |
gradient: Gradient { |
| 32 |
// top shadow |
| 33 |
GradientStop { |
| 34 |
position: 0.02 |
| 35 |
color: dividerStyle.topColor |
| 36 |
} |
| 37 |
// middle (background) |
| 38 |
GradientStop { |
| 39 |
position: 0.05 |
| 40 |
color: dividerStyle.color |
| 41 |
} |
| 42 |
GradientStop { |
| 43 |
position: 0.95 |
| 44 |
color: dividerStyle.color |
| 45 |
} |
| 46 |
// bottom highlight |
| 47 |
GradientStop { |
| 48 |
position: 0.98 |
| 49 |
color: dividerStyle.bottomColor |
| 50 |
} |
| 51 |
} |
| 52 |
} |
| 53 |
} |