1
0
Fork 0
mirror of https://github.com/kbumsik/VirtScreen.git synced 2025-03-09 15:40:18 +00:00

AppWindow: Improved releiability of auto-closing window

This commit is contained in:
Bumsik Kim 2018-05-27 00:44:32 -04:00
parent 41c483764b
commit 1ac430cdc0
No known key found for this signature in database
GPG key ID: E31041C8EC5B01C6
2 changed files with 8 additions and 5 deletions

View file

@ -10,7 +10,7 @@ ApplicationWindow {
id: window
visible: false
flags: Qt.FramelessWindowHint
title: "Basic layouts"
title: "VirtScreen"
property int theme_color: settings.theme_color
Material.theme: Material.Light

View file

@ -40,6 +40,9 @@ Item {
Timer {
id: timer
function setTimeout(cb, delayTime) {
if (timer.running) {
console.log('Timer is already running!');
}
timer.interval = delayTime;
timer.repeat = false;
timer.triggered.connect(cb);
@ -97,9 +100,6 @@ Item {
window.show();
window.raise();
window.requestActivate();
timer.setTimeout (function() {
sysTrayIcon.clicked = false;
}, 200);
}
}
@ -111,7 +111,7 @@ Item {
"../icon/icon.png"
visible: true
property bool clicked: false
onMessageClicked: console.log("Message clicked")
Component.onCompleted: {
// without delay, the message appears in a wierd place
timer.setTimeout (function() {
@ -127,6 +127,9 @@ Item {
return;
}
sysTrayIcon.clicked = true;
timer.setTimeout (function() {
sysTrayIcon.clicked = false;
}, 200);
mainLoader.active = true;
}