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:
parent
41c483764b
commit
1ac430cdc0
2 changed files with 8 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue