最小化应用程序时的电子win.flashFrame()方法 [英] Electron win.flashFrame() method when app is minimized
问题描述
win.flashFrame()
使任务栏图标闪烁,直到单击该图标并且应用程序窗口再次重新成为焦点(在Windows 10上)
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.
如何防止这种情况?
推荐答案
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"
});
这篇关于最小化应用程序时的电子win.flashFrame()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!