Add onscreenapp
[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                 onReleased: {
98                     btn1.highlighted = false
99                     eventHandler.onScreenReply(btn1.text)
100                 }
101                 onPressed: {
102                     btn1.highlighted = true
103                 }
104                 onCanceled: {
105                     btn1.highlighted = false
106                 }
107                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
108             }
109
110             Button {
111                 id: btn2
112                 visible: btn2Name == "" ? false : true
113                 text: btn2Name
114                 onReleased: {
115                     btn2.highlighted = false
116                     eventHandler.onScreenReply(btn2.text)
117                 }
118                 onPressed: {
119                     btn2.highlighted = true
120                 }
121                 onCanceled: {
122                     btn2.highlighted = false
123                 }
124                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
125             }
126
127             Button {
128                 id: btn3
129                 visible: btn3Name == "" ? false : true
130                 text: btn3Name
131                 onReleased: {
132                     btn3.highlighted = false
133                     eventHandler.onScreenReply(btn3.text)
134                 }
135                 onPressed: {
136                     btn3.highlighted = true
137                 }
138                 onCanceled: {
139                     btn3.highlighted = false
140                 }
141                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
142             }
143         }
144
145         Rectangle {
146             id: footer
147             opacity: 0
148             width: parent.width
149             height: 5
150             anchors {
151                 bottom: parent.bottom
152             }
153         }
154     }
155
156 }