-
Notifications
You must be signed in to change notification settings - Fork 340
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
Improve draw_rounded_rect and fix progress bar #1213
Conversation
Note that this is a much more general solution compared to #1183 |
cairo_fill(c); | ||
|
||
// border | ||
cairo_set_source_rgba(c, cl->frame.r, cl->frame.g, cl->frame.b, cl->frame.a); | ||
cairo_set_line_width(c, frame_width * scale); | ||
draw_rounded_rect(c, | ||
frame_x + half_frame_width, | ||
frame_y + half_frame_width, |
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 seems to improve/fix one of the problem in #1178 where the bar frame is offset from the fill
// right side (background) | ||
cairo_set_source_rgba(c, cl->bg.r, cl->bg.g, cl->bg.b, cl->bg.a); | ||
draw_rounded_rect(c, x_bar_2, frame_y, progress_width_2, progress_height, | ||
settings.progress_bar_corner_radius, scale, true, true); |
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.
Filling the whole bar with the background and then applying the fill afterwards fixed the problem where the background and the bar mismatched when there were rounded corners
At this point it should be complete. Here a demonstration of what can it do thanks to the added flexibility of |
Hey, thanks for picking up this issue! Those images are very clear in explaining the changes. But as you said, you got a bit carried away :) That's a good thing, only the way you structured your changes make it very hard to review this PR. This PR contains a bunch of different changes that belong in different PR's. Your commits also often do more than one thing, for example changing code and fixing some white spacing. To make it easier for me to review these changes and to get them merged in a timely manner, I want to ask you to do some reordering of these changes. I would start by tackling the issue described in #1178 in a new PR. So this should only contain changes to fix this issue, no added features or white space fixes. You can take a look at this article if you want to know more. |
Hello, dividing the fix for #1178 from the implementation of The two main things I changed are:
If it's really needed I can split the first and the second in two different prs, but as I said before these two things are strictly related. |
@fwsmit Following your advice I made a separate branch ((https://github.com/bynect/dunst/tree/corners-part1)) with only the first part of this pr (the change in draw_rounded_rect to use corner_pos and apply corrections when needed). |
Is there a problem stopping this? |
I haven't got around to reviewing the branch you posted. Could you post it as a PR? That makes it easier to find |
This PR is superseeded by #1227 |
I started this pr to fix the problem with the progress bar described in #1178.
However I got carried away and also updated
draw_rounded_rectangle
to be more generic on which corners to round.I plan on adding a configuration option to select which corners should be rounded.
These are some of the possible corner configurations: