Electron win.flashFrame() method when app is minimized

放肆的年华 提交于 2021-01-28 07:57:46

问题


win.flashFrame() makes tray icon flash until the icon is clicked and the app window is back in the focus again (on Windows 10)

However, if the app is minimized, the flashing ends automatically after just a couple of seconds without even clicking on the icon.

How can I prevent this?


回答1:


If the window is minimized the user won't see the window flash, you will need to use the win.setProgressBar funciton. This will make a loading bar behind the icon in the tray, you can also set the mode of the progress bar to indeterminate and set the progress to 100% and it will flash yellow/orange. This is a general standard used by lots of applications to get a users attention when the app is minimized.

win.setProgressBar(1, {
    mode: "indeterminate"
});


来源:https://stackoverflow.com/questions/45504387/electron-win-flashframe-method-when-app-is-minimized

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!