Merge pull request #614 from 763305292/main

Add the ability to edit ring progress bar's thickness.
This commit is contained in:
Zhang Dian
2025-05-27 16:55:38 +08:00
committed by GitHub
2 changed files with 7 additions and 5 deletions

View File

@@ -25,6 +25,7 @@
Width="100"
Height="100"
IsIndeterminate="True"
BorderThickness="16"
Maximum="{Binding #slider.Maximum}"
Minimum="{Binding #slider.Minimum}"
Theme="{DynamicResource ProgressRing}"
@@ -162,4 +163,4 @@
Value="60" />
</StackPanel>
</ScrollViewer>
</UserControl>
</UserControl>

View File

@@ -344,6 +344,7 @@
<ControlTheme x:Key="ProgressRing" TargetType="ProgressBar">
<Setter Property="Foreground" Value="{DynamicResource ProgressBarIndicatorBrush}" />
<Setter Property="Background" Value="{DynamicResource ProgressBarBackground}" />
<Setter Property="BorderThickness" Value="6" />
<Setter Property="Template">
<ControlTemplate TargetType="ProgressBar">
<Panel>
@@ -355,7 +356,7 @@
Stroke="{TemplateBinding Background}"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="6"
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
SweepAngle="360" />
<Arc
Name="Indicator"
@@ -364,7 +365,7 @@
Stroke="{TemplateBinding Foreground}"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="6"
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
SweepAngle="{TemplateBinding Percentage,
Converter={StaticResource AngleConverter}}" />
<Arc
@@ -375,7 +376,7 @@
Stroke="{TemplateBinding Foreground}"
StrokeJoin="Round"
StrokeLineCap="Round"
StrokeThickness="6"
StrokeThickness="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
SweepAngle="{TemplateBinding Percentage,
Converter={StaticResource AngleConverter}}" />
<TextBlock
@@ -443,4 +444,4 @@
</Style.Animations>
</Style>
</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>