Skip to content

Commit

Permalink
feat(ProgressBar): lightweight styling for Progress controls
Browse files Browse the repository at this point in the history
fix: pr comments
  • Loading branch information
Arieldelossantos authored and kazo0 committed Sep 28, 2023
1 parent fcb79c3 commit 862ab0f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/library/Uno.Material/Styles/Controls/v2/ProgressBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<ResourceDictionary x:Key="Default">
<StaticResource x:Key="ProgressBarForeground" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SurfaceVariantBrush" />

<x:Double x:Key="ProgressBarMinWidth">250</x:Double>
<x:Double x:Key="ProgressBarHeight">4</x:Double>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="ProgressBarForeground" ResourceKey="PrimaryBrush" />
<StaticResource x:Key="ProgressBarBackground" ResourceKey="SurfaceVariantBrush" />

<x:Double x:Key="ProgressBarMinWidth">250</x:Double>
<x:Double x:Key="ProgressBarHeight">4</x:Double>
</ResourceDictionary>
Expand Down
12 changes: 0 additions & 12 deletions src/library/Uno.Themes.WinUI.Markup/Theme.Styles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ public static class PipsPager
public static StaticResourceKey<Style> Default => new("PipsPagerStyle");
}

public static class ProgressBar
{
[ResourceKeyDefinition(typeof(Style), "ProgressBarStyle", TargetType = typeof(ProgressBar))]
public static StaticResourceKey<Style> Default => new("ProgressBarStyle");
}

public static class ProgressRing
{
[ResourceKeyDefinition(typeof(Style), "ProgressRingStyle", TargetType = typeof(ProgressRing))]
public static StaticResourceKey<Style> Default => new("ProgressRingStyle");
}

public static class Slider
{
[ResourceKeyDefinition(typeof(Style), "SliderStyle", TargetType = typeof(Slider))]
Expand Down
33 changes: 33 additions & 0 deletions src/library/Uno.Themes.WinUI.Markup/Theme/ProgressBar.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup.Internals;

namespace Uno.Themes.Markup
{
public static partial class Theme
{
public static class ProgressBar
{
public static class Resources
{
[ResourceKeyDefinition(typeof(Brush), "ProgressBarForeground")]
public static ResourceValue<Brush> Foreground => new("ProgressBarForeground", true);

[ResourceKeyDefinition(typeof(Brush), "ProgressBarBackground")]
public static ResourceValue<Brush> Background => new("ProgressBarBackground", true);

[ResourceKeyDefinition(typeof(double), "ProgressBarMinWidth")]
public static ResourceValue<double> MinWidth => new("ProgressBarMinWidth", true);

[ResourceKeyDefinition(typeof(double), "ProgressBarHeight")]
public static ResourceValue<double> Height => new("ProgressBarHeight", true);
}

public static class Styles
{
[ResourceKeyDefinition(typeof(Style), "ProgressBarStyle", TargetType = typeof(ProgressBar))]
public static ResourceValue<Style> Default => new("ProgressBarStyle");
}
}
}
}
33 changes: 33 additions & 0 deletions src/library/Uno.Themes.WinUI.Markup/Theme/ProgressRing.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup.Internals;

namespace Uno.Themes.Markup
{
public static partial class Theme
{
public static class ProgressRing
{
public static class Resources
{
public static class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "ProgressRingForeground")]
public static ResourceValue<Brush> Default => new("ProgressRingForeground", true);
}

public static class Background
{
[ResourceKeyDefinition(typeof(Brush), "ProgressRingBackground")]
public static ResourceValue<Brush> Default => new("ProgressRingBackground", true);
}
}

public static class Styles
{
[ResourceKeyDefinition(typeof(Style), "ProgressRingStyle", TargetType = typeof(ProgressRing))]
public static ResourceValue<Style> Default => new("ProgressRingStyle");
}
}
}
}

0 comments on commit 862ab0f

Please sign in to comment.