Remove unused progress bar (fixes #788)

This commit is contained in:
Matt Nadareski
2024-12-21 12:15:30 -05:00
parent f3ac31ce1b
commit 9ad917e508
8 changed files with 2 additions and 144 deletions

View File

@@ -117,6 +117,7 @@
- Adjust row count in protection options
- Pedantic GUI changes
- More pendantic GUI changes
- Remove unused progress bar
### 3.2.4 (2024-11-24)

View File

@@ -289,11 +289,6 @@
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- ProgressBar -->
<SolidColorBrush x:Key="ProgressBar.Progress" Color="#FF06B025"/>
<SolidColorBrush x:Key="ProgressBar.Background" Color="#FFE6E6E6"/>
<SolidColorBrush x:Key="ProgressBar.Border" Color="#FFBCBCBC"/>
<!-- ScrollViewer -->
<SolidColorBrush x:Key="ScrollViewer.ScrollBar.Background" Color="LightGray"/>
<SolidColorBrush x:Key="ScrollViewer.ScrollBar.Foreground" Color="DarkGray"/>

View File

@@ -301,116 +301,7 @@ namespace MPF.UI
</Style.Triggers>
</Style>";
/// <summary>
/// CustomProgressBarStyle Style XAML (.NET Framework 4.0 and above)
/// </summary>
private const string _customProgressBarStyleDefault = @"<Style x:Key=""CustomProgressBarStyle"" TargetType=""{x:Type ProgressBar}"">
<Setter Property=""Foreground"" Value=""{DynamicResource ProgressBar.Progress}""/>
<Setter Property=""Background"" Value=""{DynamicResource ProgressBar.Background}""/>
<Setter Property=""BorderBrush"" Value=""{DynamicResource ProgressBar.Border}""/>
<Setter Property=""BorderThickness"" Value=""1""/>
<Setter Property=""Template"">
<Setter.Value>
<ControlTemplate TargetType=""{x:Type ProgressBar}"">
<Grid x:Name=""TemplateRoot"">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name=""CommonStates"">
<VisualState x:Name=""Determinate""/>
<VisualState x:Name=""Indeterminate"">
<Storyboard RepeatBehavior=""Forever"">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=""(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"" Storyboard.TargetName=""Animation"">
<EasingDoubleKeyFrame KeyTime=""0"" Value=""0.25""/>
<EasingDoubleKeyFrame KeyTime=""0:0:1"" Value=""0.25""/>
<EasingDoubleKeyFrame KeyTime=""0:0:2"" Value=""0.25""/>
</DoubleAnimationUsingKeyFrames>
<PointAnimationUsingKeyFrames Storyboard.TargetProperty=""(UIElement.RenderTransformOrigin)"" Storyboard.TargetName=""Animation"">
<EasingPointKeyFrame KeyTime=""0"" Value=""-0.5,0.5""/>
<EasingPointKeyFrame KeyTime=""0:0:1"" Value=""0.5,0.5""/>
<EasingPointKeyFrame KeyTime=""0:0:2"" Value=""1.5,0.5""/>
</PointAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border BorderBrush=""{TemplateBinding BorderBrush}"" BorderThickness=""{TemplateBinding BorderThickness}"" Background=""{TemplateBinding Background}""/>
<Rectangle x:Name=""PART_Track""/>
<Grid x:Name=""PART_Indicator"" ClipToBounds=""true"" HorizontalAlignment=""Left"">
<Rectangle x:Name=""Indicator"" Fill=""{TemplateBinding Foreground}""/>
<Rectangle x:Name=""Animation"" Fill=""{TemplateBinding Foreground}"" RenderTransformOrigin=""0.5,0.5"">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property=""Orientation"" Value=""Vertical"">
<Setter Property=""LayoutTransform"" TargetName=""TemplateRoot"">
<Setter.Value>
<RotateTransform Angle=""-90""/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property=""IsIndeterminate"" Value=""true"">
<Setter Property=""Visibility"" TargetName=""Indicator"" Value=""Collapsed""/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>";
/// <summary>
/// CustomProgressBarStyle Style XAML (.NET Framework 3.5)
/// </summary>
private const string _customProgressBarStyleNet35 = @"<Style TargetType=""{x:Type ProgressBar}"">
<Setter Property=""Foreground"" Value=""{DynamicResource ProgressBar.Progress}""/>
<Setter Property=""Background"" Value=""{DynamicResource ProgressBar.Background}""/>
<Setter Property=""BorderBrush"" Value=""{DynamicResource ProgressBar.Border}""/>
<Setter Property=""BorderThickness"" Value=""1""/>
<Setter Property=""Template"">
<Setter.Value>
<ControlTemplate TargetType=""{x:Type ProgressBar}"">
<Grid x:Name=""TemplateRoot"">
<Border BorderBrush=""{TemplateBinding BorderBrush}"" BorderThickness=""{TemplateBinding BorderThickness}"" Background=""{TemplateBinding Background}""/>
<Rectangle x:Name=""PART_Track""/>
<Grid x:Name=""PART_Indicator"" ClipToBounds=""true"" HorizontalAlignment=""Left"">
<Rectangle x:Name=""Indicator"" Fill=""{TemplateBinding Foreground}""/>
<Rectangle x:Name=""Animation"" Fill=""{TemplateBinding Foreground}"" RenderTransformOrigin=""0.5,0.5"">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property=""Orientation"" Value=""Vertical"">
<Setter Property=""LayoutTransform"" TargetName=""TemplateRoot"">
<Setter.Value>
<RotateTransform Angle=""-90""/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property=""IsIndeterminate"" Value=""true"">
<Setter Property=""Visibility"" TargetName=""Indicator"" Value=""Collapsed""/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>";
#endregion
#endregion
public App()
{
@@ -425,7 +316,6 @@ namespace MPF.UI
// Create styles
CreateStyle("ComboBoxEditableTextBox");
CreateStyle("CustomComboBoxStyle");
CreateStyle("CustomProgressBarStyle");
}
/// <summary>
@@ -480,11 +370,9 @@ namespace MPF.UI
#if NET35
"ComboBoxEditableTextBox" => XamlReader.Parse(_comboBoxEditableTextBoxStyleNet35, parserContext) as Style,
"CustomComboBoxStyle" => XamlReader.Parse(_customComboBoxStyleNet35, parserContext) as Style,
"CustomProgressBarStyle" => XamlReader.Parse(_customProgressBarStyleNet35, parserContext) as Style,
#else
"ComboBoxEditableTextBox" => XamlReader.Parse(_comboBoxEditableTextBoxStyleDefault, parserContext) as Style,
"CustomComboBoxStyle" => XamlReader.Parse(_customComboBoxStyleDefault, parserContext) as Style,
"CustomProgressBarStyle" => XamlReader.Parse(_customProgressBarStyleDefault, parserContext) as Style,
#endif
_ => throw new ArgumentException($"'{resourceName}' is not a recognized style", nameof(resourceName)),
};

View File

@@ -153,15 +153,6 @@ namespace MPF.UI
#endregion
#region ProgressBar
/// <summary>
/// Brush for the ProgressBar.Background resource
/// </summary>
public Brush? ProgressBar_Background { get; protected set; }
#endregion
#region ScrollViewer
/// <summary>
@@ -239,9 +230,6 @@ namespace MPF.UI
Application.Current.Resources["MenuItem.SubMenu.Background"] = MenuItem_SubMenu_Background;
Application.Current.Resources["MenuItem.SubMenu.Border"] = MenuItem_SubMenu_Border;
// Handle ProgressBar-specific resources
Application.Current.Resources["ProgressBar.Background"] = ProgressBar_Background;
// Handle ScrollViewer-specific resources
Application.Current.Resources["ScrollViewer.ScrollBar.Background"] = ScrollViewer_ScrollBar_Background;

View File

@@ -70,9 +70,6 @@ namespace MPF.UI.Themes
MenuItem_SubMenu_Background = backgroundBrush;
MenuItem_SubMenu_Border = Brushes.DarkGray;
// Handle ProgressBar-specific resources
ProgressBar_Background = backgroundBrush;
// Handle ScrollViewer-specific resources
ScrollViewer_ScrollBar_Background = backgroundBrush;

View File

@@ -47,9 +47,6 @@ namespace MPF.UI.Themes
MenuItem_SubMenu_Background = darkModeBrush;
MenuItem_SubMenu_Border = Brushes.DarkGray;
// Handle ProgressBar-specific resources
ProgressBar_Background = darkModeBrush;
// Handle ScrollViewer-specific resources
ScrollViewer_ScrollBar_Background = darkModeBrush;

View File

@@ -65,9 +65,6 @@ namespace MPF.UI.Themes
MenuItem_SubMenu_Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xF0, 0xF0, 0xF0));
MenuItem_SubMenu_Border = Brushes.DarkGray;
// Handle ProgressBar-specific resources
ProgressBar_Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xE6, 0xE6, 0xE6));
// Handle ScrollViewer-specific resources
ScrollViewer_ScrollBar_Background = Brushes.LightGray;

View File

@@ -7,11 +7,6 @@
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<StackPanel Orientation="Vertical">
<Grid Height="22" Margin="10 10 10 0">
<ProgressBar x:Name="ProgressBar" Style="{DynamicResource CustomProgressBarStyle}" />
<TextBlock x:Name="ProgressLabel" Grid.Row="0" Height="22" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0 2 0 0" />
</Grid>
<Border Height="180" Background="White" BorderBrush="Gainsboro" BorderThickness="1" Margin="10">
<ScrollViewer Name="OutputViewer" Template="{DynamicResource CustomScrollViewerControlStyle}">
<RichTextBox Name="Output" FontFamily="Consolas" Background="#FF202020" IsReadOnly="true" />