diff --git a/main.js b/main.js index ff9f25e..252c2dd 100644 --- a/main.js +++ b/main.js @@ -2335,9 +2335,9 @@ ipcMain.on("progress-bar-set", function (event, message) { win.setOverlayIcon(nativeImage.createFromPath(path.join(__dirname, '\\res\\icons\\overlay\\' + (message.remain <= 60 ? message.remain : 61) + '.png')), progress.toString()); if (message.positive) - win.setTitle("wnr | " + i18n.__('min-already') + " " + message.remain + " " + i18n.__('min') + " | " + i18n.__('today-total') + (estimCurrent + todaySum) + ' ' + i18n.__('min')); + win.setTitle("wnr | " + i18n.__('min-already') + " " + message.remain + " " + i18n.__('min') + " | " + i18n.__('today-total') + getStyledTimeForTray(estimCurrent + todaySum)); else - win.setTitle("wnr | " + i18n.__('min-left') + " " + message.remain + " " + i18n.__('min') + " | " + i18n.__('today-total') + (estimCurrent + todaySum) + ' ' + i18n.__('min')); + win.setTitle("wnr | " + i18n.__('min-left') + " " + message.remain + " " + i18n.__('min') + " | " + i18n.__('today-total') + getStyledTimeForTray(estimCurrent + todaySum)); } } }) @@ -2347,9 +2347,9 @@ ipcMain.on("tray-time-set", function (event, message) { trayH = message.h; trayMin = message.min; if (message.positive === false) - trayTimeMsg = (trayH ? (trayH + ' ' + i18n.__('h')) : "") + trayMin + ' ' + i18n.__('min') + '| ' + timeLeftTip + " " + Math.floor(100 - progress * 100) + "% | " + i18n.__('today-total') + (estimCurrent + todaySum) + ' ' + i18n.__('min'); + trayTimeMsg = (trayH ? (trayH + ' ' + i18n.__('h')) : "") + trayMin + ' ' + i18n.__('min') + '| ' + timeLeftTip + " " + Math.floor(100 - progress * 100) + "% | " + i18n.__('today-total') + (process.platform === "win32" ? getStyledTimeForTray(estimCurrent + todaySum) : ((estimCurrent + todaySum) + ' ' + i18n.__('min'))); else { - trayTimeMsg = (trayH ? (trayH + ' ' + i18n.__('h')) : "") + trayMin + ' ' + i18n.__('min') + '| ' + positiveTimingTip + " | " + i18n.__('today-total') + (estimCurrent + todaySum) + ' ' + i18n.__('min'); + trayTimeMsg = (trayH ? (trayH + ' ' + i18n.__('h')) : "") + trayMin + ' ' + i18n.__('min') + '| ' + positiveTimingTip + " | " + i18n.__('today-total') + (process.platform === "win32" ? getStyledTimeForTray(estimCurrent + todaySum) : ((estimCurrent + todaySum) + ' ' + i18n.__('min'))); } if (tray != null) tray.setToolTip(trayTimeMsg); diff --git a/timer.html b/timer.html index 054507f..ff75dd1 100644 --- a/timer.html +++ b/timer.html @@ -515,7 +515,7 @@

$("#time-cnt").css("display", "none"); if (continueLoop || method === 3) { $("#infinity-label").css("display", "none"); - $("#time-cnt-blank").css("display", "none"); + if (!continueLoop) $("#time-cnt-blank").css("display", "none"); } } else { $("#infinity-label").css("display", "none"); @@ -586,6 +586,7 @@

} if (store.get("nap") || methodFromStart === 3) { + method = 3; shouldNap = true; napInterval = (store.has("nap-time") ? store.get("nap-time") : 10) * 60; if (isNaN(napInterval)) napInterval = 600; @@ -651,13 +652,18 @@

stopper(); if (!wasCounting) stopCounter++; - if (stopCounter) $("#stop-count").text(((method === 3 || continueLoop) ? "" : " | ") + i18n.__("already-paused") + " " + stopCounter.toString() + " " + i18n.__("time(s)")); + if (stopCounter) $("#stop-count").text(((methodFromStart === 3 || continueLoop) ? "" : " | ") + i18n.__("already-paused") + " " + stopCounter.toString() + " " + i18n.__("time(s)")); } ipc.on("can-redo-exec", function () { window.clearInterval(int); startTime = new Date().getTime(); - int = setInterval(clock, 250); + if (methodFromStart !== 3) + int = setInterval(clock, 250); + else { + $("#infinity-label").css("display", "none"); + int = setInterval(positive, 250); + } $("#stopper").html(""); isClockWorking = 1;//to restart ipc.send("tray-image-change", "start"); @@ -670,7 +676,7 @@

window.clearInterval(int); pauseInt = setTimeout(function () { ipc.send("can-redo-alert"); - }, 1000 * 10); + }, 1000 * 60 * 7); $("#stopper").html(""); isClockWorking = 0;//to stop ipc.send("tray-image-change", "stop");