mirror of
https://github.com/LinoSchmidt/StickExporterTX.git
synced 2026-05-05 12:10:42 +02:00
Added flashing and new badge on finish
This commit is contained in:
+5
-3
@@ -1,4 +1,4 @@
|
|||||||
import {app, BrowserWindow, dialog, ipcMain} from 'electron';
|
import {app, BrowserWindow, dialog, ipcMain, NativeImage} from 'electron';
|
||||||
import {initialize as remoteInitialize, enable as remoteEnable} from '@electron/remote/main';
|
import {initialize as remoteInitialize, enable as remoteEnable} from '@electron/remote/main';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { autoUpdater } from "electron-updater";
|
import { autoUpdater } from "electron-updater";
|
||||||
@@ -116,12 +116,14 @@ const createWindow = () => {
|
|||||||
const progress = parseFloat(arg);
|
const progress = parseFloat(arg);
|
||||||
mainWindow.setProgressBar(progress);
|
mainWindow.setProgressBar(progress);
|
||||||
if(progress === 1 && !mainWindow.isFocused()) {
|
if(progress === 1 && !mainWindow.isFocused()) {
|
||||||
app.setBadgeCount(1);
|
mainWindow.setOverlayIcon(path.join(__dirname, '../assets/render_finished_icon.png') as unknown as NativeImage, 'Rendering Complete');
|
||||||
|
mainWindow.flashFrame(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindow.on('focus', () => {
|
mainWindow.on('focus', () => {
|
||||||
app.setBadgeCount(0);
|
mainWindow.setOverlayIcon(null, '');
|
||||||
|
mainWindow.flashFrame(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindow.on('close', () => {
|
mainWindow.on('close', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user