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

Add transparency feature #164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

kadamski
Copy link
Contributor

It is sometimes better if the drawing is not fully covering the picture but is semi-transparent. This patch adds a simple button to enable transparency. When this button is enabled, everything will be drawn with 50% alpha channel.

@Shadorain
Copy link

Why is this PR not merged?

@jtheoof
Copy link
Owner

jtheoof commented Oct 26, 2024

I would prefer a more complete approach. If we enable transparency it would have its own slider from 0 to 100. Maybe 50% for you would not mean transparent for other users.

@@ -119,6 +126,7 @@ static void action_update_color_state(struct swappy_state *state, double r,
state->settings.g = g;
state->settings.b = b;
state->settings.a = a;
if (state->config->transparent) state->settings.a *= 0.5;
Copy link
Owner

Choose a reason for hiding this comment

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

This is just too much "magic number". Transparency, once enabled, should be configurable by the user.

It is sometimes better if the drawing is not fully covering the picture
but is semi-transparent. This patch adds a simple button to enable
transparency. When this button is enabled, everything will be drawn with
50% alpha channel.
This commit adds UI elements and config option for configuring the
transparency value. The default value is 50% but it can be changed in
the 5% - 95% range in 10% steps.
@kadamski
Copy link
Contributor Author

kadamski commented Nov 6, 2024

Ok, it took me a moment to make linter workflow happy. I didn't trigger it earlier so I didn't know it exists. I have added a new commit that implements configuration of transparency as you requested. I have left the previous commit as is with only tiny fix in src/config.h line 290 where I'm using correct default value define now. I didn't want you to have to review everything again and I think the first commit is somewhat self contained. But feel free to squash both commits if you prefer it that way. It looks like this:
obraz

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.

3 participants