summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-04-15 23:48:02 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-04-15 23:48:02 +0300
commite91a218a47f505364221c33af622ac65f6c6afd8 (patch)
tree8460ab625eedc25b4d11ec2f93318058a3649438
parentcf8c9d37ffe382974a086a79553de5997f8e8a7b (diff)
sample/app/main: Remove flickable and make it more resilient
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
-rw-r--r--sample/app/main.qml54
1 files changed, 33 insertions, 21 deletions
diff --git a/sample/app/main.qml b/sample/app/main.qml
index 609c637..b545c53 100644
--- a/sample/app/main.qml
+++ b/sample/app/main.qml
@@ -25,6 +25,10 @@ ApplicationWindow {
property string mapp_id: ''
property string mapp_data_msg: ''
+ // position of the pop-up
+ property int x: 200
+ property int y: 200
+
Label {
id: title
width: parent.width
@@ -42,24 +46,24 @@ ApplicationWindow {
anchors.horizontalCenter: title.horizontalCenter
// show received reply information area
- Flickable {
- id: flickable
- width: 800
- height: 320
- Layout.alignment: Qt.AlignCenter
- flickableDirection: Flickable.VerticalFlick
- boundsBehavior: Flickable.StopAtBounds
-
- TextArea.flickable: TextArea {
- id: output
- text: "show received reply information area\n...\n...\n...\n...\n"
- font.pixelSize: 24
- wrapMode: TextArea.Wrap
- color: '#00ADDC'
- }
-
- ScrollBar.vertical: ScrollBar { }
- }
+ //Flickable {
+ // id: flickable
+ // width: 400
+ // height: 220
+ // Layout.alignment: Qt.AlignCenter
+ // flickableDirection: Flickable.VerticalFlick
+ // boundsBehavior: Flickable.StopAtBounds
+
+ // TextArea.flickable: TextArea {
+ // id: output
+ // text: "show received reply information area\n...\n...\n...\n...\n"
+ // font.pixelSize: 12
+ // wrapMode: TextArea.Wrap
+ // color: '#00ADDC'
+ // }
+
+ // ScrollBar.vertical: ScrollBar { }
+ // }
// select onscreen type area
GroupBox {
@@ -366,7 +370,7 @@ ApplicationWindow {
if (!onscreen_role_set) {
console.log("onscreen_role_set is not set")
- eventHandler.set_window_popup(onsId, 0, 218)
+ eventHandler.set_window_popup(onsId, x, y)
console.log("setting for popup for " + onsId)
onscreen_role_set = true
}
@@ -385,13 +389,21 @@ ApplicationWindow {
armTimer(onsId, postmsg)
} else {
// onscreenapp is already start we just need to activate + pass the data
- eventHandler.showWindow(mapp_id, mapp_data_msg)
+ if (!eventHandler.is_running(onsId) && pid > 0) {
+ // this is mostly for testing, in case onscreenapp died
+ // unexpectedly
+ eventHandler.set_window_popup(onsId, x, y)
+ pid = eventHandler.start(onsId, postmsg)
+ armTimer(onsId, postmsg)
+ } else {
+ eventHandler.showWindow(onsId, postmsg)
+ }
}
}
function qmlOnReplyShowWindow(text) {
console.log("onstestapp received:",text);
- output.text = text;
+ //output.text = text;
}
}