Skip to content
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

feat: add shadow color for inactive windows #230

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

eerii
Copy link
Contributor

@eerii eerii commented Oct 18, 2023

Solves #228.

This pull request adds a configuration option for changing the inactive windows' shadow color, shadow_inactive_color. It follows the same syntax as shadow_color. If it is not defined, it takes the default value of shadow_color, there is no change for existing configurations.

This is my first time contributing to this project and one of my first pull requests, so please if there is anything I have to do differently or change tell me. (Also thank you, I have been using this as my main desktop and couldn't be happier!)

2023-10-18.22-26-03.mp4

@AnotherRandomGitHubAccount

Tested this out locally. can't find any bugs and works amazing! Thanks! can't wait for somebody to approve it

sway/desktop/render.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@ErikReider ErikReider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'll let @WillPower3309 merge this just in case he has any final thoughts :)

Copy link
Owner

@WillPower3309 WillPower3309 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one nit

Comment on lines +20 to +22
if (memcmp(config->shadow_color, config->shadow_inactive_color, sizeof(config->shadow_color)) == 0) {
color_to_rgba(config->shadow_inactive_color, color);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would result in shadow_inactive_color being set twice (once here and then again in the shadow_inactive_color command file), so this can be omitted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is there so if you only set the shadow_color (and not the shadow_inactive_color) both of them are set to your custom one like right now, so that the changes are backward compatible. It does mean that it is set twice but the alternative is to make everyone change the configs to also add shadow_inactive_color even if they want shadows to be uniform. I'm ok changing it either way though, so please tell me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if shadow_inactive_color is already set that is ignored, that's what the memcmp is for, so you can define them in any order.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah got it, misinterpreted the comparison

@WillPower3309
Copy link
Owner

This repo is pretty complex, great work as a first contributor!

@WillPower3309
Copy link
Owner

Feel free to ping me if you're on the SwayFX discord server for the contributor role

@eerii
Copy link
Contributor Author

eerii commented Oct 23, 2023

This repo is pretty complex, great work as a first contributor!

Thank you! ^^

@WillPower3309 WillPower3309 reopened this Oct 23, 2023
@WillPower3309 WillPower3309 merged commit 2d6944d into WillPower3309:master Oct 23, 2023
@eerii eerii deleted the multicolored-shadows branch October 23, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants