change 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                 highlighted: true
98                 onClicked: {
99                     eventHandler.onScreenReply(btn1.text)
100                 }
101                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
102             }
103
104             Button {
105                 id: btn2
106                 visible: btn2Name == "" ? false : true
107                 text: btn2Name
108                 highlighted: true
109                 onClicked: {
110                     eventHandler.onScreenReply(btn2.text)
111                 }
112                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
113             }
114
115             Button {
116                 id: btn3
117                 visible: btn3Name == "" ? false : true
118                 text: btn3Name
119                 highlighted: true
120                 onClicked: {
121                     eventHandler.onScreenReply(btn3.text)
122                 }
123                 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
124             }
125         }
126
127         Rectangle {
128             id: footer
129             opacity: 0
130             width: parent.width
131             height: 5
132             anchors {
133                 bottom: parent.bottom
134             }
135         }
136     }
137
138 }