1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-19 06:14:04 +00:00

Zenity progress bar

This commit is contained in:
2023-02-21 20:11:40 +01:00
parent 44c94d0d72
commit 5dd9e0573d
8 changed files with 63 additions and 3 deletions

View File

@ -1,13 +1,26 @@
import { StartProgressBar, StopProgressBar } from '$wails/go/ui/UI';
import { writable } from 'svelte/store';
const { update, subscribe } = writable(0);
let timer;
let progressBarShown = false;
subscribe(isBusy => {
if (isBusy) {
document.body.classList.add('busy');
if (!progressBarShown) {
progressBarShown = true;
timer = setTimeout(() => StartProgressBar(''), 100);
}
}
else {
if (timer) {
clearTimeout(timer);
timer = undefined;
}
progressBarShown = false;
document.body.classList.remove('busy');
StopProgressBar();
}
});