-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS Blurred Background #1520
base: trunk
Are you sure you want to change the base?
MacOS Blurred Background #1520
Conversation
@@ -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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if opacity is zero, the output will be "#ffffff0", which is an invalid color code.
The opacity part should always have exactly 2 digits.
Is this supported by other OSes? Seems like macOS only: https://www.electronjs.org/docs/latest/api/browser-window#winsetvibrancytype-macos I want the app behavior to be same across platforms. |
Firstly, thanks for your reply and your awesome work in genral! It's not supported by other OSes. A cross-platform solution will be much more complicated. Stretchly already has a non cross-platform feature - do-not-disturb doesn't work on MacOS. I recently found a similar paid app, called LookAway. One of their two strengths, compared to Stretchly, is that they have this beautiful blur effect, and that they have a good meetings detection. Anyway, I don't have a PC or a linux-based computer, so I won't be able to code/test other OSes. |
Well DND was supported until Apple changed things and I am not able to detect it anymore. Anyway, I think if we have this as advanced option with default to |
Ok, fair point :) An advanced option sounds amazing, I'll work on it on the weekend. Sure, I can try using the counterpart Windows' option, but I'll need someone else to test it. |
Great, if you can try adding Windows as well, I can test it. I will see if anything can be done on Linux as well. |
I made it an advanced option, and also added Windows support that should be tested. :) |
Partially solving issue #280
Adding a simple blurred background on MacOS.
I think it should be the default behavior, but maybe it should be configurable.
It plays nice with the other configurations, such as
opacity
,transparentMode
andminiBreakColor
.I also added support to opacities below 0.0392156863 (=10/255), see the comment in the Review page.
Screenshot (the buttons at the top left side of the window were like that before my change, I assume it's like that when running from source):