Skip to content

Commit

Permalink
optimized for mac exp
Browse files Browse the repository at this point in the history
  • Loading branch information
RoderickQiu committed May 1, 2020
1 parent 57768a1 commit e23ce66
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,6 @@
"personalization-white-or-dark-tip": "Select whether you like light mode or the dark one.",
"personalization-white-or-dark-mode-white": "Light Mode",
"personalization-white-or-dark-mode-dark": "Dark Mode",
"personalization-white-or-dark-mode-auto": "Auto Switch"
"personalization-white-or-dark-mode-auto": "Auto Switch",
"stopped": "Stopped"
}
5 changes: 3 additions & 2 deletions locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"working": "工作",
"resting": "休息",
"looping": "循环",
"time-left": "% 时间剩余",
"time-left": "% 剩余",
"add": "添加",
"delete": "删除",
"predefined-tasks-settings": "预设设置",
Expand Down Expand Up @@ -213,5 +213,6 @@
"personalization-white-or-dark-tip": "选择是始终使用明亮模式、暗黑模式还是自动切换(部分系统不支持自动切换,将会始终使用明亮模式)。",
"personalization-white-or-dark-mode-white": "明亮模式",
"personalization-white-or-dark-mode-dark": "暗黑模式",
"personalization-white-or-dark-mode-auto": "自动选择"
"personalization-white-or-dark-mode-auto": "自动选择",
"stopped": "已暂停"
}
5 changes: 3 additions & 2 deletions locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"working": "工作",
"resting": "休息",
"looping": "循環",
"time-left": "% 時間剩余",
"time-left": "% 剩余",
"add": "添加",
"delete": "刪除",
"predefined-tasks-settings": "預設設置",
Expand Down Expand Up @@ -213,5 +213,6 @@
"personalization-white-or-dark-tip": "選擇是始終使用明亮模式、暗黑模式還是自動切換(部分系統不支持自動切換,將會始終使用明亮模式)。",
"personalization-white-or-dark-mode-white": "明亮模式",
"personalization-white-or-dark-mode-dark": "暗黑模式",
"personalization-white-or-dark-mode-auto": "自動選擇"
"personalization-white-or-dark-mode-auto": "自動選擇",
"stopped": "已暫停"
}
17 changes: 12 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,10 @@ function notificationSolution(title, body, func) {
function traySolution(isFullScreen) {
if (app.isReady()) {
if (tray != null) {
if (!isTimerWin) tray.setImage(path.join(__dirname, '\\res\\icons\\iconWin.ico'));
if (!isTimerWin) {
if (process.platform == "win32") tray.setImage(path.join(__dirname, '\\res\\icons\\iconWin.ico'));
else tray.setTitle("");
}
}
if (!isFullScreen) {
if ((!store.get("islocked")) && win != null) win.closable = true;
Expand Down Expand Up @@ -1451,12 +1454,14 @@ ipcMain.on('only-one-min-left', function () {
})

ipcMain.on('tray-image-change', function (event, message) {
if (tray != null && process.platform == "win32") {
if (tray != null) {
if (message == "stop") {
tray.setImage(path.join(__dirname, '\\res\\icons\\wnrIconStopped.png'));
if (process.platform == "win32") tray.setImage(path.join(__dirname, '\\res\\icons\\wnrIconStopped.png'));
else tray.setTitle(" " + i18n.__('stopped'));
isStopped = true;
} else {
tray.setImage(path.join(__dirname, '\\res\\icons\\iconWin.ico'));
if (process.platform == "win32") tray.setImage(path.join(__dirname, '\\res\\icons\\iconWin.ico'));
else tray.setTitle(" " + 100 - (progress * 100) + timeLeftTip);
isStopped = false;
}
}
Expand All @@ -1466,8 +1471,10 @@ ipcMain.on("progress-bar-set", function (event, message) {
progress = 1 - message / 100;
if (win != null) win.setProgressBar(progress);
if (tray != null) tray.setToolTip(message + timeLeftTip)
if (process.platform == "darwin")
if (process.platform == "darwin") {
if (timeLeftOnBar != null) timeLeftOnBar.label = message + timeLeftTip;
if (tray != null) tray.setTitle(" " + message + timeLeftTip);
}
})

ipcMain.on("notify", function (event, message) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wnr",
"version": "1.15.1",
"version": "1.15.2",
"description": "Work and rest, with wnr now!",
"main": "main.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions timer.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ <h3>
$(".time-bar-focus").removeClass("time-bar-focus");
$nowTiming.removeClass("display-1");
$nowTiming.addClass("h1");
$("#fullscreen-experience-tip").css("display", "none");
}
warningGiver(1);
} else {
Expand Down Expand Up @@ -416,6 +417,7 @@ <h3>
$(".time-bar-focus").removeClass("time-bar-focus");
$nowTiming.removeClass("display-1");
$nowTiming.addClass("h1");
$("#fullscreen-experience-tip").css("display", "none");
}
if (shouldNap) {
lastNapSecond = workTime / 1000;
Expand All @@ -431,6 +433,7 @@ <h3>
canStop = false;
window.clearInterval(int);
$("#only-one").css("display", "none");
$("#fullscreen-experience-tip").css("display", "none");
$("#work-rest").text("");
$nowTiming.text(i18n.__('ended'));
isClockWorking = 0;
Expand Down

0 comments on commit e23ce66

Please sign in to comment.