最小化应用程序时的电子win.flashFrame()方法 [英] Electron win.flashFrame() method when app is minimized

查看:65
本文介绍了最小化应用程序时的电子win.flashFrame()方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆