【发布时间】:2016-04-12 11:31:44
【问题描述】:
我有一个在菜单栏中运行的电子应用程序。
代码目前主要基于现有的番茄钟应用 (https://github.com/G07cha/pomodoro)
当计时器到达某个点时,它会打开一个消息框:
ipc.on('end-timer', function() {
$('.timer').circleProgress('value', 1);
var isRelaxTime = remote.getGlobal('isRelaxTime');
dialog.showMessageBox({
type: 'info',
title: 'Pomodoro',
message: (isRelaxTime) ? 'Timer ended it\'s time to relax' : 'Back to work',
buttons: ['OK'],
noLink: true
}, function() {
if(isRelaxTime) {
$('.timer').circleProgress({fill: { gradient: ["blue", "skyblue"]}});
} else {
$('#counter').text(remote.getGlobal('pomodoroCount'));
$('.timer').circleProgress({fill: { gradient: ["orange", "yellow"]}});
}
ipc.send('start-timer');
});
});
是否可以打开一个新窗口而不是消息框,并使其全屏显示?
基本上,确保用户看到它并在计时器到时填满屏幕,并允许自定义带有 css 等的页面。
【问题讨论】:
标签: javascript node.js electron