-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added support for coloring unfocused windows different. #37
base: main
Are you sure you want to change the base?
Conversation
Could you please add a mention of this feature in the readme? |
Definitely! |
The manager code was changed in 0c41e83 so there is a conflict now, can you please update your changes? Sorry for the inconvenience |
Thanks Pavel! Yeah, I'll push an update this evening when I finish up some other things. |
That was a rough merge, haha. I ended up just re-applying the changes. |
Reminder this is here :D |
Don't worry, I'm remember, I'm just on vacation rn and can't really use my laptop, I'll get to this in a week or so |
@@ -385,6 +386,7 @@ function refreshShadow(actor: ExtensionsWindowActor) { | |||
const {border_radius, padding} = getRoundedCornersCfg(win); | |||
|
|||
updateShadowActorStyle(win, shadow, border_radius, shadowSettings, padding); | |||
refreshRoundedCorners(actor); |
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.
Why are you refreshing rounded corners in refreshShadow
? Since this only has to be called when window focus is changed, you should instead change the definition of onFocusChanged
to something like this:
export function onFocusChanged(actor: ExtensionsWindowActor) {
refreshShadow(actor);
refreshRoundedCorners(actor);
}
It's also possible to only update the border color uniform without recalculating everything else (see implementation of RoundedCornersEffect.update_uniforms
for details), but I think that would just add a bunch of unnecessary functions and abstraction level mixing. Though if you think it may be a good option you can still try and see if you like how it feels.
@@ -418,14 +420,19 @@ function refreshRoundedCorners(actor: ExtensionsWindowActor): void { | |||
|
|||
const windowContentOffset = computeWindowContentsOffset(win); | |||
|
|||
const focused = win.appears_focused; | |||
const border_color = focused |
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.
const border_color = focused | |
const borderColor = focused |
The JS convention is to use lowerCamelCase for variable names, GNOME code uses snake_case for some reason so @yilozt probably went with snake case as well to be consistent with it, but I think it's better to just use the JS convention when possible
@@ -442,6 +449,6 @@ function refreshRoundedCorners(actor: ExtensionsWindowActor): void { | |||
|
|||
/** Refresh rounded corners settings for all windows. */ | |||
function refreshAllRoundedCorners() { | |||
global.get_window_actors().forEach(refreshRoundedCorners); | |||
global.get_window_actors().forEach(actor => refreshRoundedCorners(actor)); |
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 already fixed this in 98096c7, you should rebase on top of the latest commit
@@ -23,6 +23,7 @@ export const General = GObject.registerClass( | |||
'skip_libhandy', | |||
'border_width', | |||
'border_color', | |||
'unfocused_border_color', |
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 you're calling this unfocused_border_color
it probably makes sense to rename the other one to focused_border_color
5018872
to
7f38800
Compare
@bsneed could you please update this? |
I was about to ask if something like this existed, this is great 👍🏽 |
Closes #41