change sample
[apps/onscreenapp.git] / app / Onscreen.qml
1 import QtQuick 2.0
2 import QtQuick.Layouts 1.1
3 import QtQuick.Controls 2.0
4
5 Rectangle {
6     id: mainform
7     height: 300
8     width: 1000
9     radius:2
10
11     gradient: Gradient {
12         GradientStop { position: 0.0; color: "#12262E" }
13         GradientStop { position: 1.0; color: "#18899B" }
14     }
15
16     ColumnLayout {
17         anchors {
18           topMargin: 10; bottomMargin:10
19           leftMargin: 20; rightMargin: 20
20           fill: parent
21         }
22         spacing: 2
23
24         ColumnLayout {
25             id: title_part
26             anchors {
27                 top: parent.top
28                 left: parent.left
29                     topMargin: 10
30             }
31
32             Label {
33                 id: title
34                 text: dsp_title
35                 color: "white"
36                 font.pixelSize: 32
37                 font.bold: true
38                 maximumLineCount: 1
39                 wrapMode: Text.Wrap
40                 elide: Text.ElideRight
41                 horizontalAlignment: Label.AlignHCenter
42                 verticalAlignment: Label.AlignVCenter
43                 Layout.preferredWidth:  960
44                 Layout.preferredHeight:  40
45             }
46
47             Image {
48                 source: '../images/DividingLine.svg'
49                 anchors.left: title.left
50                 anchors.top: title.bottom
51             }
52         }
53
54         RowLayout {
55             id: contents_part
56             anchors {
57               left: parent.left; leftMargin: 20
58               right: parent.right; rightMargin: 20
59             }
60             Layout.preferredWidth: 920
61             Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
62             spacing: 10
63             Image {
64                 id: dsp_mark
65                 source: dsp_icon
66                 Layout.maximumHeight: 120
67                 Layout.maximumWidth:  120
68             }
69             Label {
70                 text: dsp_contents
71                 color: "white"
72                 font.pixelSize: 24
73                 wrapMode: Text.Wrap
74                 maximumLineCount: btn_area.visible ? 4 : 5
75                 elide: Text.ElideRight
76                 horizontalAlignment: Label.AlignLeft
77                 verticalAlignment: Label.AlignVCenter
78                 Layout.preferredWidth: 780
79                 Layout.preferredHeight: 160
80             }
81         }
82
83         RowLayout {
84             id: btn_area
85             spacing: 60
86             visible: btnNum > 0 ? true : false
87             anchors {
88               horizontalCenter: parent.horizontalCenter
89             }
90             Layout.preferredWidth: parent.width*0.75
91             Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
92
93             Button {
94                 id: btn1
95                 visible: btn1Name == "" ? false : true
96                 text: btn1Name
97                 onClicked: {
98                     eventHandler.onScreenReply(btn1.text)
99                 }
100                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
101             }
102
103             Button {
104                 id: btn2
105                 visible: btn2Name == "" ? false : true
106                 text: btn2Name
107                 onClicked: {
108                     eventHandler.onScreenReply(btn2.text)
109                 }
110                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
111             }
112
113             Button {
114                 id: btn3
115                 visible: btn3Name == "" ? false : true
116                 text: btn3Name
117                 onClicked: {
118                     eventHandler.onScreenReply(btn3.text)
119                 }
120                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
121             }
122         }
123
124         Rectangle {
125             id: footer
126             opacity: 0
127             width: parent.width
128             height: 5
129             anchors {
130                 bottom: parent.bottom
131             }
132         }
133     }
134
135 }