Skip to content

Added rounded corners option for progress bar#1119

Merged
fwsmit merged 3 commits intomasterfrom
unknown repository
Dec 13, 2022
Merged

Added rounded corners option for progress bar#1119
fwsmit merged 3 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Oct 28, 2022

This PR adds the option progress_bar_corner_radius to enable rounded corners on the progress bar. If its value is non-zero, draw_rounded_rect is used in place of draw_rect to render the bar. Please let me know if anything needs to be changed!

Copy link
Copy Markdown
Member

@fwsmit fwsmit left a comment

Choose a reason for hiding this comment

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

Thank you for making this PR. It looks pretty good. I've added a few comments. The main thing is that you need to check if the lines of the progress bar are not blurry. This is because of the way cairo draws lines.

Comment thread src/settings.h Outdated
Comment thread src/draw.c Outdated
Comment thread src/draw.c Outdated
Comment thread src/draw.c Outdated
Comment thread src/settings.c Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 30, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.25%. Comparing base (53a2ff1) to head (cb8d9a4).
⚠️ Report is 544 commits behind head on master.

Files with missing lines Patch % Lines
src/draw.c 33.33% 6 Missing ⚠️
src/settings.c 50.00% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1119      +/-   ##
==========================================
- Coverage   65.26%   65.25%   -0.01%     
==========================================
  Files          46       46              
  Lines        7358     7362       +4     
==========================================
+ Hits         4802     4804       +2     
- Misses       2556     2558       +2     
Flag Coverage Δ
unittests 65.25% <38.46%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/settings.c Outdated
@fwsmit
Copy link
Copy Markdown
Member

fwsmit commented Nov 23, 2022

@vlfldr would you mind finishing this PR?

@ghost
Copy link
Copy Markdown
Author

ghost commented Nov 27, 2022

@fwsmit Sorry for the delay. Just want to clarify, when you say "With whole number scaling it should work like this" in a comment above do you mean it should work as-is with the parameters changed to floats, or it should work by rounding to the nearest .5?

I am going to hold off on passing the frame width to draw_rounded_rect to support fractional scaling for now as it would involved either overloading or touching more of the codebase than this PR intended to.

@fwsmit
Copy link
Copy Markdown
Member

fwsmit commented Nov 27, 2022

@fwsmit Sorry for the delay. Just want to clarify, when you say "With whole number scaling it should work like this" in a comment above do you mean it should work as-is with the parameters changed to floats, or it should work by rounding to the nearest .5?

It should work as is. You can best check this by setting the progress bar width to 1 and seeing if the progress bar border is a nice 1-pixel line and not a blurry multi-pixel line.

I've tested it and it works great.

I am going to hold off on passing the frame width to draw_rounded_rect to support fractional scaling for now as it would involved either overloading or touching more of the codebase than this PR intended to.

Okay that's fine

@fwsmit
Copy link
Copy Markdown
Member

fwsmit commented Nov 27, 2022

After you address the open comment it's good

…s with information regarding potential blurry lines.
@fwsmit
Copy link
Copy Markdown
Member

fwsmit commented Dec 13, 2022

Thanks! This is a great addition to dunst. I'll go ahead and merge it

@fwsmit fwsmit merged commit e1289f4 into dunst-project:master Dec 13, 2022
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.

2 participants