summaryrefslogtreecommitdiff
path: root/demo/Pages/Basic/ButtonPage.qml
blob: 6cf94fe49cfb832bfa26afe94fdd97877c94d5f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 * This file is part of Fluid.
 *
 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
 *
 * $BEGIN_LICENSE:MPL2$
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * $END_LICENSE$
 */

import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import Fluid.Controls 1.0
import "../.."

Flickable {
    clip: true
    contentHeight: Math.max(layout.implicitHeight, height)

    ScrollBar.vertical: ScrollBar {}

    ColumnLayout {
        id: layout
        anchors.fill: parent

        Repeater {
            model: 2

            StyledRectangle {
                Layout.fillWidth: true
                Layout.fillHeight: true
                Layout.minimumWidth: grid.width + 80
                Layout.minimumHeight: grid.height + 80

                GridLayout {
                    id: grid
                    anchors.centerIn: parent
                    columns: 2
                    rows: 4

                    // Row 1

                    TitleLabel {
                        text: qsTr("Enabled")

                        Layout.alignment: Qt.AlignHCenter
                    }

                    TitleLabel {
                        text: qsTr("Disabled")

                        Layout.alignment: Qt.AlignHCenter
                    }

                    // Row 2

                    Button {
                        text: qsTr("Button")
                    }

                    Button {
                        text: qsTr("Button")
                        enabled: false
                    }

                    // Row 3

                    Button {
                        text: qsTr("Checked")
                        checkable: false
                        checked: true
                    }

                    Button {
                        text: qsTr("Checked")
                        checkable: false
                        checked: true
                        enabled: false
                    }

                    // Row 4

                    Button {
                        text: qsTr("Flat")
                        flat: true
                    }

                    Button {
                        text: qsTr("Flat")
                        flat: true
                        enabled: false
                    }

                    // Row 5

                    Button {
                        text: qsTr("Highlighted")
                        highlighted: true
                    }

                    Button {
                        text: qsTr("Highlighted")
                        highlighted: true
                        enabled: false
                    }
                }
            }
        }
    }
}