From 00b90c5858114f7e8be583668082b7c1bac45aa2 Mon Sep 17 00:00:00 2001 From: Jan Hovancik Date: Mon, 12 Feb 2024 20:23:43 +0100 Subject: [PATCH] Add advanced option to show break actions in Strict mode --- CHANGELOG.md | 1 + README.md | 3 +++ app/main.js | 12 ++++++++---- app/utils/defaultSettings.js | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad999ffd6..823a2a54a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Estonia and Belarus translations - Updated flag of Belarus to White-Red-White +- advanced option to show break options (Skip, Pause, Reset) in Strict mode ### Changed - updated many translations diff --git a/README.md b/README.md index 3785c423c..4488b92ce 100644 --- a/README.md +++ b/README.md @@ -358,6 +358,9 @@ To hide Stretchly icon in menubar/tray, set the value of `showTrayIcon` from `tr Note that this will disable graphical way of opening Stretchly Preferences. To access Preferences, you will have to use command line options (ie: `stretchly preferences` on Linux). +#### Show break actions (Skip, Pause, Reset) in Strict Mode +If you want to show options 'Skip to next break', 'Pause' or 'Reset Breaks' even while in Strict mode, set `showBreakActionsInStrictMode` to `true`. + ## Contributor Preferences *Stretchly* is free but you can support it by contributing code, translations or money. You will be rewarded by getting access to **Contributor Preferences**, ability to **Sync Preferences**, chat on **Discord** and more! diff --git a/app/main.js b/app/main.js index c61aec803..e64c3a6c2 100644 --- a/app/main.js +++ b/app/main.js @@ -1253,9 +1253,11 @@ function getTrayMenuTemplate () { }) } - if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode')) { + if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode') && + !settings.get('showBreakActionsInStrictMode')) { // nothing - } else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode')) { + } else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode') && + !settings.get('showBreakActionsInStrictMode')) { // nothing } else if (!(breakPlanner.isPaused || breakPlanner.dndManager.isOnDnd || breakPlanner.appExclusionsManager.isSchedulerCleared)) { let submenu = [] @@ -1287,9 +1289,11 @@ function getTrayMenuTemplate () { updateTray() } }) - } else if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode')) { + } else if (breakPlanner.scheduler.reference === 'finishMicrobreak' && settings.get('microbreakStrictMode') && + !settings.get('showBreakActionsInStrictMode')) { // nothing - } else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode')) { + } else if (breakPlanner.scheduler.reference === 'finishBreak' && settings.get('breakStrictMode') && + !settings.get('showBreakActionsInStrictMode')) { // nothing } else if (!(breakPlanner.dndManager.isOnDnd || breakPlanner.appExclusionsManager.isSchedulerCleared)) { trayMenu.push({ diff --git a/app/utils/defaultSettings.js b/app/utils/defaultSettings.js index a70823257..cda6d6ae3 100644 --- a/app/utils/defaultSettings.js +++ b/app/utils/defaultSettings.js @@ -67,5 +67,6 @@ module.exports = { skipToNextScheduledBreakShortcut: '', skipToNextMiniBreakShortcut: '', skipToNextLongBreakShortcut: '', - resetBreaksShortcut: '' + resetBreaksShortcut: '', + showBreakActionsInStrictMode: false }