~zsombi/ubuntu-ui-toolkit/03-styleditem-styleset

« back to all changes in this revision

Viewing changes to tests/resources/header/automaticColors.qml

  • Committer: Zsombor Egri
  • Date: 2015-03-10 18:03:58 UTC
  • mfrom: (1434.1.13 02-styleset)
  • Revision ID: zsombor.egri@canonical.com-20150310180358-aunnni7a9z9k9c7h
prereq sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013-2015 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
 
 
17
import QtQuick 2.4
 
18
import Ubuntu.Components 1.2
 
19
 
 
20
MainView {
 
21
    id: mainView
 
22
    width: units.gu(50)
 
23
    height: units.gu(70)
 
24
 
 
25
    Page {
 
26
        title: "Colors"
 
27
 
 
28
        head.actions: [
 
29
            Action {
 
30
                iconName: "close"
 
31
                text: "one"
 
32
            },
 
33
            Action {
 
34
                iconName: "close"
 
35
                text: "two"
 
36
            },
 
37
            Action {
 
38
                iconName: "close"
 
39
                text: "three"
 
40
            }
 
41
        ]
 
42
 
 
43
        Column {
 
44
            height: childrenRect.height
 
45
            width: parent.width - units.gu(8)
 
46
            spacing: units.gu(1)
 
47
            anchors.centerIn: parent
 
48
 
 
49
            Button {
 
50
                anchors {
 
51
                    left: parent.left
 
52
                    right: parent.right
 
53
                }
 
54
                text: "Light"
 
55
                onTriggered: {
 
56
                    mainView.backgroundColor = "#eeeeee";
 
57
                    mainView.headerColor = mainView.backgroundColor;
 
58
                    mainView.footerColor = mainView.backgroundColor;
 
59
                }
 
60
            }
 
61
            Button {
 
62
                anchors {
 
63
                    left: parent.left
 
64
                    right: parent.right
 
65
                }
 
66
                text: "Dark"
 
67
                onTriggered: {
 
68
                    mainView.backgroundColor = "#333333";
 
69
                    mainView.headerColor = mainView.backgroundColor;
 
70
                    mainView.footerColor = mainView.backgroundColor;
 
71
                }
 
72
            }
 
73
            Button {
 
74
                anchors {
 
75
                    left: parent.left
 
76
                    right: parent.right
 
77
                }
 
78
                text: "Gradient"
 
79
                onTriggered: {
 
80
                    mainView.backgroundColor = "#6A69A2";
 
81
                    mainView.headerColor ="#343C60";
 
82
                    mainView.footerColor = "#8896D5";
 
83
                }
 
84
            }
 
85
        }
 
86
    }
 
87
}