-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 ProgressRing #6003
Add ProgressRing #6003
Conversation
Update to latest master
Merge latest changes
Update to latest master
src/Avalonia.Controls/Converters/ProgressRingEndsToPathDataConverter.cs
Outdated
Show resolved
Hide resolved
I would like to mention what dragging window by the titlebar on windows would stop the animation |
src/Avalonia.Controls/Converters/ProgressRingEndsToPathDataConverter.cs
Outdated
Show resolved
Hide resolved
Yeah @maxkatz6 and I had a nice discussion about that on Discord last night...I think a better plan for that is starting to take shape. |
set => SetValue(PreserveAspectProperty, value); | ||
} | ||
|
||
public double ValueAngle |
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.
If this property was added only to simplify templating, it makes sense to move it to inner property with relevant name.
See https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/ProgressBar.cs#L151
So it's it will be like "TemplateProperties.ValueAngle"
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.
Meaning that developers shouldn't try to use it elsewhere
I think the progress clock or filled progress ring is a good idea. Actually, I would argue the "progress ring" is a special case of the "progress clock" where the thickness of the "slice" is reduced to only the edge. To achieve this correctly I think you need another shape. Just like a rectangle is the two-dimensional equivalent of a line, a sector is the two-dimensional equivalent of an arc. Adding a sector shape would allow you to achieve the "progress clock" look using the same math (angle calculation) as for the ring. That said, sometimes you want a 'hollow' donut shape so I'll need to check if there is a good/established way to set an inside and outside diameter of a sector. I also looked in more detail at the
|
Also, this could be useful for you |
I will close that PR, i tried to make it work with a master, but sadly it doesn't work correctly, but even original implementation consumes around ~300mb of memory on my PC(memory consumption jumps from 200mb to 500mb), Splitwirez will not be able to update this PR because he has deleted the branch so I think we can close that PR |
I wonder if majority of memory usages comes from this part, which is executed each animation tick It might make sense to create something like FluentProgressRingPresenter in Fluent project which will render specific ring animation directly to the context without animations. Similarly with Default theme. In this way it still will be possible to change progress ring template and build-in implementation will work nicely (should). |
...if the |
At least we don't need to copy geometry to apply transforms Also rotation can be done with a transform and not with recalculating whole geometry. |
What does the pull request do?
Adds the bagel-shaped
ProgressRing
control to Avalonia, as seen in WinUI....wait, were they supposed to be gluten-free?What is the current behavior?
Avalonia has progress-indicating controls in baguette shape, but not bagel shape.
What is the updated/expected behavior with this PR?
A bagel-shaped progress-indicating control called
ProgressRing
is now available for use in Avalonia. How many different ways do you need me to spell it out? lolHow was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
None...?
Obsoletions / Deprecations
None
Fixed issues
N/A, the matter was raised in a Discussion post, not an Issue post