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

Circular Progress: Fix the minor indeterminate animation #3681

Merged
merged 3 commits into from Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,14 @@
@namespace MudBlazor.Docs.Examples

<MudItem Class="d-flex justify-space-around">
<MudProgressCircular Color="Color.Primary" Style="height:70px;width:70px;" Value="@_val" Indeterminate="false" StrokeWidth="4" />
<MudProgressCircular Color="Color.Primary" Style="height:70px;width:70px;" Value="@_val" Rounded="true" Indeterminate="false" StrokeWidth="4" />
</MudItem>

<MudItem Class="mt-4">
<MudSlider @bind-Value="_val">Change Value - Current: @_val</MudSlider>
</MudItem>

@code{
int _val = 75;
}
Expand Up @@ -54,6 +54,14 @@
<ProgressCircularSizesExample />
</SectionContent>
<SectionSource Code="ProgressCircularSizesExample" GitHubFolderName="Progress" />
</DocsPageSection>
<DocsPageSection>
<SectionHeader Title="Rounded Circular">
</SectionHeader>
<SectionContent FullWidth="true" Outlined="true">
<ProgressCircularRoundedExample />
</SectionContent>
<SectionSource Code="ProgressCircularRoundedExample" GitHubFolderName="Progress" />
</DocsPageSection>
</DocsPageContent>
<DocsPageContent>
Expand Down
@@ -1,7 +1,7 @@
@namespace MudBlazor
@inherits MudComponentBase

<div @attributes="UserAttributes" class="@DivClassname" role="progressbar" style="@DivStyle" aria-valuenow="@Value">
<div @attributes="UserAttributes" class="@DivClassname" role="progressbar" style="@Style" aria-valuenow="@Value">
<svg class="mud-progress-circular-svg" viewBox="22 22 44 44">
@if (Indeterminate)
{
Expand Down
11 changes: 7 additions & 4 deletions src/MudBlazor/Components/Progress/MudProgressCircular.razor.cs
Expand Up @@ -15,6 +15,7 @@ public partial class MudProgressCircular : MudComponentBase
.AddClass($"mud-progress-{Size.ToDescriptionString()}")
.AddClass($"mud-progress-indeterminate", Indeterminate)
.AddClass($"mud-progress-static", !Indeterminate)
.AddClass("mud-progress-circular-rounded", Rounded)
.AddClass(Class)
.Build();

Expand All @@ -24,10 +25,12 @@ public partial class MudProgressCircular : MudComponentBase
.AddClass($"mud-progress-static", !Indeterminate)
.Build();

protected string DivStyle =>
new StyleBuilder("transform", "rotate(-90deg)")
.AddStyle(Style)
.Build();
/// <summary>
/// Sets the stroke rounded or not.
/// </summary>
[Parameter]
mckaragoz marked this conversation as resolved.
Show resolved Hide resolved
[Category(CategoryTypes.ProgressCircular.Appearance)]
public bool Rounded { get; set; } = false;

JonBunator marked this conversation as resolved.
Show resolved Hide resolved
/// <summary>
/// The color of the component. It supports the theme colors.
Expand Down
5 changes: 5 additions & 0 deletions src/MudBlazor/Styles/components/_progresscircular.scss
Expand Up @@ -11,6 +11,10 @@
transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

&.mud-progress-circular-rounded {
stroke-linecap: round;
}

&.mud-progress-small {
height: 24px;
width: 24px;
Expand All @@ -30,6 +34,7 @@

.mud-progress-circular-svg {
display: block;
transform: rotate(-90deg);
}

.mud-progress-circular-circle {
Expand Down