summaryrefslogtreecommitdiffstats
path: root/app/Onscreen.qml
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-02-13 18:10:20 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-02-15 10:56:06 +0800
commitaee1b69e8e207081a3d8b2670980671a9fbc78b8 (patch)
tree86e71a4d08908c8c6711400a810bbbb00f19f803 /app/Onscreen.qml
parent483c21f9d648f2cd58e00f39fcbee7b5dcbe2bc5 (diff)
Add onscreenapp
Onscreenapp is a qt application for showing onscreens. Applications can show/hide onscreen by calling homescreen-service's showWindow/hideWindow verb. Applications also can customize onscreen's title,type, display contents and buttons. Some images about onscreen pattern had uploaded in JIRA SPEC-1967. Bug-AGL: SPEC-1967 Change-Id: I421193f7d089584a26db629be27414d050a74337 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Diffstat (limited to 'app/Onscreen.qml')
-rw-r--r--app/Onscreen.qml156
1 files changed, 156 insertions, 0 deletions
diff --git a/app/Onscreen.qml b/app/Onscreen.qml
new file mode 100644
index 0000000..cfad090
--- /dev/null
+++ b/app/Onscreen.qml
@@ -0,0 +1,156 @@
+import QtQuick 2.0
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+
+Rectangle {
+ id: mainform
+ height: 300
+ width: 1000
+ radius:2
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#12262E" }
+ GradientStop { position: 1.0; color: "#18899B" }
+ }
+
+ ColumnLayout {
+ anchors {
+ topMargin: 10; bottomMargin:10
+ leftMargin: 20; rightMargin: 20
+ fill: parent
+ }
+ spacing: 2
+
+ ColumnLayout {
+ id: title_part
+ anchors {
+ top: parent.top
+ left: parent.left
+ topMargin: 10
+ }
+
+ Label {
+ id: title
+ text: dsp_title
+ color: "white"
+ font.pixelSize: 32
+ font.bold: true
+ maximumLineCount: 1
+ wrapMode: Text.Wrap
+ elide: Text.ElideRight
+ horizontalAlignment: Label.AlignHCenter
+ verticalAlignment: Label.AlignVCenter
+ Layout.preferredWidth: 960
+ Layout.preferredHeight: 40
+ }
+
+ Image {
+ source: '../images/DividingLine.svg'
+ anchors.left: title.left
+ anchors.top: title.bottom
+ }
+ }
+
+ RowLayout {
+ id: contents_part
+ anchors {
+ left: parent.left; leftMargin: 20
+ right: parent.right; rightMargin: 20
+ }
+ Layout.preferredWidth: 920
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
+ spacing: 10
+ Image {
+ id: dsp_mark
+ source: dsp_icon
+ Layout.maximumHeight: 120
+ Layout.maximumWidth: 120
+ }
+ Label {
+ text: dsp_contents
+ color: "white"
+ font.pixelSize: 24
+ wrapMode: Text.Wrap
+ maximumLineCount: btn_area.visible ? 4 : 5
+ elide: Text.ElideRight
+ horizontalAlignment: Label.AlignLeft
+ verticalAlignment: Label.AlignVCenter
+ Layout.preferredWidth: 780
+ Layout.preferredHeight: 160
+ }
+ }
+
+ RowLayout {
+ id: btn_area
+ spacing: 60
+ visible: btnNum > 0 ? true : false
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ }
+ Layout.preferredWidth: parent.width*0.75
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+
+ Button {
+ id: btn1
+ visible: btn1Name == "" ? false : true
+ text: btn1Name
+ onReleased: {
+ btn1.highlighted = false
+ eventHandler.onScreenReply(btn1.text)
+ }
+ onPressed: {
+ btn1.highlighted = true
+ }
+ onCanceled: {
+ btn1.highlighted = false
+ }
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ }
+
+ Button {
+ id: btn2
+ visible: btn2Name == "" ? false : true
+ text: btn2Name
+ onReleased: {
+ btn2.highlighted = false
+ eventHandler.onScreenReply(btn2.text)
+ }
+ onPressed: {
+ btn2.highlighted = true
+ }
+ onCanceled: {
+ btn2.highlighted = false
+ }
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ }
+
+ Button {
+ id: btn3
+ visible: btn3Name == "" ? false : true
+ text: btn3Name
+ onReleased: {
+ btn3.highlighted = false
+ eventHandler.onScreenReply(btn3.text)
+ }
+ onPressed: {
+ btn3.highlighted = true
+ }
+ onCanceled: {
+ btn3.highlighted = false
+ }
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ }
+ }
+
+ Rectangle {
+ id: footer
+ opacity: 0
+ width: parent.width
+ height: 5
+ anchors {
+ bottom: parent.bottom
+ }
+ }
+ }
+
+}