dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.44k stars 338 forks source link

Improve draw_rounded_rect and fix progress bar #1213

Closed bynect closed 6 months ago

bynect commented 9 months ago

I started this pr to fix the problem with the progress bar described in #1178.

Before After
image image
image image

image

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:

1 2
image image
image image
bynect commented 9 months ago

Note that this is a much more general solution compared to #1183

bynect commented 9 months ago

At this point it should be complete. Here a demonstration of what can it do thanks to the added flexibility of corners, progress_bar_corners and icon_corners. On top of that the progress bar offset and blurriness was improved a bit and the flip around error occurring at small percentages was resolved.

image

fwsmit commented 9 months ago

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.

bynect commented 9 months ago

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 corners would be somehow counterproductive because I still have to create a corner_pos enum. If you want I can remove the white space fixes, I did them because I noticed some styling inconsistencies.

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.

bynect commented 9 months ago

@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). I hope this is easier to review. Honestly I would prefer if this pr could be merged as one piece, but if I need to create 2 other prs I'll adapt 😮‍💨

bynect commented 8 months ago

Is there a problem stopping this?

fwsmit commented 8 months ago

I haven't got around to reviewing the branch you posted. Could you post it as a PR? That makes it easier to find

fwsmit commented 6 months ago

This PR is superseeded by #1227