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
|
id: window
|
||||||
visible: false
|
visible: false
|
||||||
flags: Qt.FramelessWindowHint
|
flags: Qt.FramelessWindowHint
|
||||||
title: "Basic layouts"
|
title: "VirtScreen"
|
||||||
|
|
||||||
property int theme_color: settings.theme_color
|
property int theme_color: settings.theme_color
|
||||||
Material.theme: Material.Light
|
Material.theme: Material.Light
|
||||||
|
|
|
@ -40,6 +40,9 @@ Item {
|
||||||
Timer {
|
Timer {
|
||||||
id: timer
|
id: timer
|
||||||
function setTimeout(cb, delayTime) {
|
function setTimeout(cb, delayTime) {
|
||||||
|
if (timer.running) {
|
||||||
|
console.log('Timer is already running!');
|
||||||
|
}
|
||||||
timer.interval = delayTime;
|
timer.interval = delayTime;
|
||||||
timer.repeat = false;
|
timer.repeat = false;
|
||||||
timer.triggered.connect(cb);
|
timer.triggered.connect(cb);
|
||||||
|
@ -97,9 +100,6 @@ Item {
|
||||||
window.show();
|
window.show();
|
||||||
window.raise();
|
window.raise();
|
||||||
window.requestActivate();
|
window.requestActivate();
|
||||||
timer.setTimeout (function() {
|
|
||||||
sysTrayIcon.clicked = false;
|
|
||||||
}, 200);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ Item {
|
||||||
"../icon/icon.png"
|
"../icon/icon.png"
|
||||||
visible: true
|
visible: true
|
||||||
property bool clicked: false
|
property bool clicked: false
|
||||||
onMessageClicked: console.log("Message clicked")
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// without delay, the message appears in a wierd place
|
// without delay, the message appears in a wierd place
|
||||||
timer.setTimeout (function() {
|
timer.setTimeout (function() {
|
||||||
|
@ -127,6 +127,9 @@ Item {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sysTrayIcon.clicked = true;
|
sysTrayIcon.clicked = true;
|
||||||
|
timer.setTimeout (function() {
|
||||||
|
sysTrayIcon.clicked = false;
|
||||||
|
}, 200);
|
||||||
mainLoader.active = true;
|
mainLoader.active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue