From 239d4d3f36f77d642f5508842f0218f25a9ea234 Mon Sep 17 00:00:00 2001 From: Sophia Saiada Date: Tue, 17 Dec 2024 21:48:32 +0200 Subject: [PATCH 1/5] MacOS Vibrancy --- app/main.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/main.js b/app/main.js index 16caf5e6..fb0936f5 100644 --- a/app/main.js +++ b/app/main.js @@ -668,6 +668,17 @@ function startBreakNotification () { updateTray() } +function getBreakWindowVibrancyOptions () { + if (settings.get('transparentMode') || settings.get('fullscreen') || process.platform !== 'darwin') { + return {} + } + + return { + vibrancy: 'hud', + visualEffectState: 'active' + } +} + function startMicrobreak () { // don't start another break if break running if (microbreakWins) { @@ -704,6 +715,7 @@ function startMicrobreak () { show: false, backgroundThrottling: false, transparent: true, + ...getBreakWindowVibrancyOptions(), backgroundColor: calculateBackgroundColor(settings.get('miniBreakColor')), skipTaskbar: !showBreaksAsRegularWindows, focusable: showBreaksAsRegularWindows, @@ -852,6 +864,7 @@ function startBreak () { show: false, backgroundThrottling: false, transparent: true, + ...getBreakWindowVibrancyOptions(), backgroundColor: calculateBackgroundColor(settings.get('mainColor')), skipTaskbar: !showBreaksAsRegularWindows, focusable: showBreaksAsRegularWindows, @@ -1064,7 +1077,7 @@ function calculateBackgroundColor (color) { if (settings.get('transparentMode')) { opacityMultiplier = settings.get('opacity') } - return color + Math.round(opacityMultiplier * 255).toString(16) + return color + Math.round(opacityMultiplier * 255).toString(16).padStart(2, '0') } function loadIdeas () { From 3212c553940bea7f2732d0220c392f8f3009c404 Mon Sep 17 00:00:00 2001 From: Sophia Saiada Date: Fri, 20 Dec 2024 15:21:36 +0200 Subject: [PATCH 2/5] Make it an advanced setting & add Windows support --- README.md | 2 +- app/main.js | 23 ++++++++++++++++------- app/utils/defaultSettings.js | 1 + 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 266adeb5..5a78c6f8 100644 --- a/README.md +++ b/README.md @@ -302,7 +302,7 @@ In the preferences file, change `mainColor` to whatever color you like. To show the Welcome window again on the next start, change `"isFirstRun"` to `true`. #### Theme transparency [![Contributor Preferences](https://img.shields.io/badge/Contributor_Preferences-✔-success)](#contributor-preferences) -To specify how solid the break window should be when Theme transparency is enabled, set the value of `opacity` from `0` to `1` (which is in turn 0 to 100%). +To specify how solid the break window should be when Theme transparency is enabled, set the value of `opacity` from `0` to `1` (which is in turn 0 to 100%). If you want the break window to have a blurred background, set the value of `blurredBackground` to `true`. #### Break window size [![Contributor Preferences](https://img.shields.io/badge/Contributor_Preferences-✔-success)](#contributor-preferences) To specify the size of the break window, set the value of `breakWindowHeight` and `breakWindowWidth` from `0` to `0.99` (which is in turn 0 to 99% of the size of the screen). Don't set 100% as that's fullscreen. diff --git a/app/main.js b/app/main.js index fb0936f5..b3d3cb5b 100644 --- a/app/main.js +++ b/app/main.js @@ -668,14 +668,23 @@ function startBreakNotification () { updateTray() } -function getBreakWindowVibrancyOptions () { - if (settings.get('transparentMode') || settings.get('fullscreen') || process.platform !== 'darwin') { +function getBlurredBackgroundWindowOptions () { + if (!settings.get('blurredBackground')) { return {} } - return { - vibrancy: 'hud', - visualEffectState: 'active' + switch (process.platform) { + case 'darwin': + return { + vibrancy: 'hud', + visualEffectState: 'active' + } + case 'win32': + return { + backgroundMaterial: 'acrylic' + } + default: + return {} } } @@ -715,7 +724,7 @@ function startMicrobreak () { show: false, backgroundThrottling: false, transparent: true, - ...getBreakWindowVibrancyOptions(), + ...getBlurredBackgroundWindowOptions(), backgroundColor: calculateBackgroundColor(settings.get('miniBreakColor')), skipTaskbar: !showBreaksAsRegularWindows, focusable: showBreaksAsRegularWindows, @@ -864,7 +873,7 @@ function startBreak () { show: false, backgroundThrottling: false, transparent: true, - ...getBreakWindowVibrancyOptions(), + ...getBlurredBackgroundWindowOptions(), backgroundColor: calculateBackgroundColor(settings.get('mainColor')), skipTaskbar: !showBreaksAsRegularWindows, focusable: showBreaksAsRegularWindows, diff --git a/app/utils/defaultSettings.js b/app/utils/defaultSettings.js index a0f1f8df..0a8bf82b 100644 --- a/app/utils/defaultSettings.js +++ b/app/utils/defaultSettings.js @@ -27,6 +27,7 @@ module.exports = { mainColor: '#478484', miniBreakColor: '#478484', transparentMode: false, + blurredBackground: false, opacity: 0.9, audio: 'crystal-glass', miniBreakAudio: 'crystal-glass', From d0f4826ea025e12e105a745901a516e7237686f4 Mon Sep 17 00:00:00 2001 From: Sophia Saiada Date: Fri, 20 Dec 2024 15:25:30 +0200 Subject: [PATCH 3/5] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50d9373b..c88a3011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Bengali, Catalan, Greek and Serbian translations - it is not possible to close app during break that is in strict mode - `logs` command line option to show location of logs +- advanced option to make window breaks' background blurred ### Fixed - error when end break shortcut is not set From a63c58e0b6ae613d08463623c980993b80033e94 Mon Sep 17 00:00:00 2001 From: Sophie Saiada Date: Fri, 20 Dec 2024 17:30:41 +0200 Subject: [PATCH 4/5] Fix a type I made in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88a3011..9f9bf7b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Bengali, Catalan, Greek and Serbian translations - it is not possible to close app during break that is in strict mode - `logs` command line option to show location of logs -- advanced option to make window breaks' background blurred +- advanced option to make break windows' background blurred ### Fixed - error when end break shortcut is not set From 31d16461999f4463c2c60eab1fd9ba61c228661b Mon Sep 17 00:00:00 2001 From: Sophia Saiada Date: Mon, 23 Dec 2024 13:39:41 +0200 Subject: [PATCH 5/5] remove windows code --- app/main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/main.js b/app/main.js index b3d3cb5b..7592545c 100644 --- a/app/main.js +++ b/app/main.js @@ -679,10 +679,6 @@ function getBlurredBackgroundWindowOptions () { vibrancy: 'hud', visualEffectState: 'active' } - case 'win32': - return { - backgroundMaterial: 'acrylic' - } default: return {} }