-
Notifications
You must be signed in to change notification settings - Fork 16.2k
feat: add {get|set}AccentColor
on Windows
#47741
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
base: main
Are you sure you want to change the base?
Conversation
@codebytere nice, just to clarify: this method - when called - changes the option only for the window its called on, it will not impact other windows? So essentially each window can have its own behaviour around |
@bpasero yes, correct! |
41e722c
to
9daba33
Compare
9daba33
to
767e34c
Compare
0cc62a7
to
9ab68b0
Compare
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.
LGTM, minor nit
9ab68b0
to
d093701
Compare
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.
I'm wondering if it'd be better to have getAccentColor
reflect what was passed to setAccentColor
, rather than trying to insert the system color if accent_color_
is true
. It feels weird for getAccentColor
to return less granular information than what was passed into setAccentColor
🤔
|
||
Sets the system accent color and highlighting of active window border. | ||
|
||
#### `win.getAccentColor()` _Windows_ |
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.
It looks like with this API, it won't be possible to distinguish between a window which has its accent color pinned to the system accent color (e.g. via setAccentColor(true)
) and a window that happens to have the same color as the system accent color (e.g. via setAccentColor(systemPreferences.getAccentColor())
).
Do we want to have a way to explicitly check if a window's accent color follows the System Settings?
|
||
#### `win.getAccentColor()` _Windows_ | ||
|
||
Returns `string | null` - the system accent color and highlighting of active window border in RGB format. |
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.
This is documented as string | null
but the implementation seems to be string | false
.
Description of Change
Closes #47584.
Adds the ability to change window accent color on Windows after initial window initialization.
cc @bpasero
Demo
https://gist.github.com/237ddda00daa4fe47fe7b11a4abd9f61
Checklist
npm test
passesRelease Notes
Notes: Adds the ability to change window accent color on Windows after initial window initialization via
{get|set}AccentColor
.