Skip to content

Commit

Permalink
refactor: reorganize standalone bush resources (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 authored Oct 26, 2023
1 parent 6640857 commit e2b11e4
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 86 deletions.
61 changes: 41 additions & 20 deletions src/library/Uno.Themes.WinUI.Markup/Theme/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ public static partial class StateLayerBackground
public static ThemeResourceKey<Brush> PointerFocused => new("ElevatedButtonStateLayerBackgroundPointerFocused");
}

[ResourceKeyDefinition(typeof(Brush), "ElevatedButtonForeground")]
public static ThemeResourceKey<Brush> Foreground => new("ElevatedButtonForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "ElevatedButtonForeground")]
public static ThemeResourceKey<Brush> Default => new("ElevatedButtonForeground");
}

[ResourceKeyDefinition(typeof(bool), "ElevatedButtonIsTintEnabled")]
public static StaticResourceKey<bool> IsTintEnabled => new("ElevatedButtonIsTintEnabled");
Expand Down Expand Up @@ -157,8 +160,11 @@ public static partial class StateLayerBackground
[ResourceKeyDefinition(typeof(double), "ButtonElevation")]
public static ThemeResourceKey<double> Elevation => new("ButtonElevation");

[ResourceKeyDefinition(typeof(Brush), "FilledButtonForeground")]
public static ThemeResourceKey<Brush> Foreground => new("FilledButtonForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "FilledButtonForeground")]
public static ThemeResourceKey<Brush> Default => new("FilledButtonForeground");
}

[ResourceKeyDefinition(typeof(Thickness), "ButtonMargin")]
public static ThemeResourceKey<Thickness> Margin => new("ButtonMargin");
Expand Down Expand Up @@ -226,8 +232,11 @@ public static partial class StateLayerBackground
[ResourceKeyDefinition(typeof(double), "ButtonElevation")]
public static ThemeResourceKey<double> Elevation => new("ButtonElevation");

[ResourceKeyDefinition(typeof(Brush), "FilledTonalButtonForeground")]
public static ThemeResourceKey<Brush> Foreground => new("FilledTonalButtonForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "FilledTonalButtonForeground")]
public static ThemeResourceKey<Brush> Default => new("FilledTonalButtonForeground");
}

[ResourceKeyDefinition(typeof(Thickness), "ButtonMargin")]
public static ThemeResourceKey<Thickness> Margin => new("ButtonMargin");
Expand All @@ -253,20 +262,26 @@ public static partial class OpacityHiddenState
public static ThemeResourceKey<double> PointerOver => new("IconButtonOpacityVisibleState");
}

[ResourceKeyDefinition(typeof(Brush), "IconButtonEllipseFillFocused")]
public static ThemeResourceKey<Brush> EllipseFillFocused => new("IconButtonEllipseFillFocused");
public static partial class Fill
{
[ResourceKeyDefinition(typeof(Brush), "IconButtonEllipseFillFocused")]
public static ThemeResourceKey<Brush> Focused => new("IconButtonEllipseFillFocused");

[ResourceKeyDefinition(typeof(Brush), "IconButtonEllipseFillPointerOver")]
public static ThemeResourceKey<Brush> EllipseFillPointerOver => new("IconButtonEllipseFillPointerOver");
[ResourceKeyDefinition(typeof(Brush), "IconButtonEllipseFillPointerOver")]
public static ThemeResourceKey<Brush> PointerOver => new("IconButtonEllipseFillPointerOver");

[ResourceKeyDefinition(typeof(Brush), "IconButtonEllipseFillPressed")]
public static ThemeResourceKey<Brush> EllipseFillPressed => new("IconButtonEllipseFillPressed");
[ResourceKeyDefinition(typeof(Brush), "IconButtonEllipseFillPressed")]
public static ThemeResourceKey<Brush> Pressed => new("IconButtonEllipseFillPressed");
}

[ResourceKeyDefinition(typeof(Brush), "IconButtonForeground")]
public static ThemeResourceKey<Brush> Foreground => new("IconButtonForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "IconButtonForeground")]
public static ThemeResourceKey<Brush> Default => new("IconButtonForeground");

[ResourceKeyDefinition(typeof(Brush), "IconButtonForegroundDisabled")]
public static ThemeResourceKey<Brush> ForegroundDisabled => new("IconButtonForegroundDisabled");
[ResourceKeyDefinition(typeof(Brush), "IconButtonForegroundDisabled")]
public static ThemeResourceKey<Brush> Disabled => new("IconButtonForegroundDisabled");
}
}

public static partial class Outlined
Expand Down Expand Up @@ -328,8 +343,11 @@ public static partial class StateLayerBackground
[ResourceKeyDefinition(typeof(Thickness), "OutlinedButtonBorderThickness")]
public static ThemeResourceKey<Thickness> BorderThickness => new("OutlinedButtonBorderThickness");

[ResourceKeyDefinition(typeof(Brush), "OutlinedButtonForeground")]
public static ThemeResourceKey<Brush> Foreground => new("OutlinedButtonForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "OutlinedButtonForeground")]
public static ThemeResourceKey<Brush> Default => new("OutlinedButtonForeground");
}
}

public static partial class Text
Expand Down Expand Up @@ -388,8 +406,11 @@ public static partial class StateLayerBackground
public static ThemeResourceKey<Brush> PointerFocused => new("TextButtonStateLayerBackgroundPointerFocused");
}

[ResourceKeyDefinition(typeof(Brush), "TextButtonForeground")]
public static ThemeResourceKey<Brush> Foreground => new("TextButtonForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "TextButtonForeground")]
public static ThemeResourceKey<Brush> Default => new("TextButtonForeground");
}

[ResourceKeyDefinition(typeof(Thickness), "TextButtonPadding")]
public static ThemeResourceKey<Thickness> Padding => new("TextButtonPadding");
Expand Down
36 changes: 24 additions & 12 deletions src/library/Uno.Themes.WinUI.Markup/Theme/CalendarDatePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ public static partial class BorderBrush

public static partial class Header
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerHeaderForeground")]
public static ThemeResourceKey<Brush> Foreground => new("CalendarDatePickerHeaderForeground");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerHeaderForegroundDisabled")]
public static ThemeResourceKey<Brush> ForegroundDisabled => new("CalendarDatePickerHeaderForegroundDisabled");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerHeaderForeground")]
public static ThemeResourceKey<Brush> Default => new("CalendarDatePickerHeaderForeground");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerHeaderForegroundDisabled")]
public static ThemeResourceKey<Brush> Disabled => new("CalendarDatePickerHeaderForegroundDisabled");
}
}

public static partial class TextForeground
Expand All @@ -67,6 +70,12 @@ public static partial class TextForeground
public static ThemeResourceKey<Brush> Selected => new("CalendarDatePickerTextForegroundSelected");
}

public static partial class BottomBorderBrush
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBottomBorderBrush")]
public static ThemeResourceKey<Brush> Default => new("CalendarDatePickerBottomBorderBrush");
}

[ResourceKeyDefinition(typeof(CornerRadius), "CalendarDatePickerBackgroundCornerRadius")]
public static ThemeResourceKey<CornerRadius> BackgroundCornerRadius => new("CalendarDatePickerBackgroundCornerRadius");

Expand All @@ -76,20 +85,23 @@ public static partial class TextForeground
[ResourceKeyDefinition(typeof(Thickness), "CalendarDatePickerBorderThemeThickness")]
public static ThemeResourceKey<Thickness> BorderThemeThickness => new("CalendarDatePickerBorderThemeThickness");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerBottomBorderBrush")]
public static ThemeResourceKey<Brush> BottomBorderBrush => new("CalendarDatePickerBottomBorderBrush");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerCalendarGlyphForegroundDisabled")]
public static ThemeResourceKey<Brush> CalendarGlyphForegroundDisabled => new("CalendarDatePickerCalendarGlyphForegroundDisabled");
public static partial class CalendarGlyphForeground
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerCalendarGlyphForegroundDisabled")]
public static ThemeResourceKey<Brush> Disabled => new("CalendarDatePickerCalendarGlyphForegroundDisabled");
}

[ResourceKeyDefinition(typeof(Thickness), "CalendarDatePickerContentMargin")]
public static ThemeResourceKey<Thickness> ContentMargin => new("CalendarDatePickerContentMargin");

[ResourceKeyDefinition(typeof(CornerRadius), "CalendarDatePickerCornerRadius")]
public static ThemeResourceKey<CornerRadius> CornerRadius => new("CalendarDatePickerCornerRadius");

[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerForeground")]
public static ThemeResourceKey<Brush> Foreground => new("CalendarDatePickerForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "CalendarDatePickerForeground")]
public static ThemeResourceKey<Brush> Default => new("CalendarDatePickerForeground");
}

[ResourceKeyDefinition(typeof(double), "CalendarDatePickerHeight")]
public static ThemeResourceKey<double> Height => new("CalendarDatePickerHeight");
Expand Down
14 changes: 10 additions & 4 deletions src/library/Uno.Themes.WinUI.Markup/Theme/ComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,17 @@ public static partial class Background
public static ThemeResourceKey<Brush> Unfocused => new("ComboBoxBackgroundUnfocused");
}

[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBorderBrush")]
public static ThemeResourceKey<Brush> BorderBrush => new("ComboBoxDropDownBorderBrush");
public static partial class BorderBrush
{
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBorderBrush")]
public static ThemeResourceKey<Brush> Default => new("ComboBoxDropDownBorderBrush");
}

[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownForeground")]
public static ThemeResourceKey<Brush> Foreground => new("ComboBoxDropDownForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownForeground")]
public static ThemeResourceKey<Brush> Default => new("ComboBoxDropDownForeground");
}
}

public static partial class Foreground
Expand Down
67 changes: 44 additions & 23 deletions src/library/Uno.Themes.WinUI.Markup/Theme/DatePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,31 @@ public static partial class DateTextForeground

public static class Flyout
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterBackground")]
public static ThemeResourceKey<Brush> Background => new("DatePickerFlyoutPresenterBackground");
public static partial class Background
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterBackground")]
public static ThemeResourceKey<Brush> Default => new("DatePickerFlyoutPresenterBackground");
}

[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterBorderBrush")]
public static ThemeResourceKey<Brush> BorderBrush => new("DatePickerFlyoutPresenterBorderBrush");
public static partial class BorderBrush
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterBorderBrush")]
public static ThemeResourceKey<Brush> Default => new("DatePickerFlyoutPresenterBorderBrush");
}

[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterSpacerFill")]
public static ThemeResourceKey<Brush> SpacerFill => new("DatePickerFlyoutPresenterSpacerFill");
public static partial class SpacerFill
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterSpacerFill")]
public static ThemeResourceKey<Brush> Default => new("DatePickerFlyoutPresenterSpacerFill");
}

[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterHighlightFill")]
public static ThemeResourceKey<Brush> HighlightFill => new("DatePickerFlyoutPresenterHighlightFill");
public static partial class HighlightFill
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterHighlightFill")]
public static ThemeResourceKey<Brush> Default => new("DatePickerFlyoutPresenterHighlightFill");
}

public static class Typography
public static partial class Typography
{
[ResourceKeyDefinition(typeof(FontFamily), "DatePickerFlyoutPresenterFontFamily")]
public static ThemeResourceKey<FontFamily> FontFamily => new("DatePickerFlyoutPresenterFontFamily");
Expand All @@ -114,21 +126,27 @@ public static class Typography
public static ThemeResourceKey<double> FontSize => new("DatePickerFlyoutPresenterFontSize");
}

[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutButtonBackground")]
public static ThemeResourceKey<Brush> ButtonBackground => new("DatePickerFlyoutButtonBackground");

public static class ButtonOpacity
public static partial class Button
{
[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutButtonOpacityPressed")]
public static ThemeResourceKey<double> Pressed => new("DatePickerFlyoutButtonOpacityPressed");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutButtonOpacityDisabled")]
public static ThemeResourceKey<double> Disabled => new("DatePickerFlyoutButtonOpacityDisabled");
public static partial class Background
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutButtonBackground")]
public static ThemeResourceKey<Brush> Default => new("DatePickerFlyoutButtonBackground");
}

public static class Opacity
{
[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutButtonOpacityPressed")]
public static ThemeResourceKey<double> Pressed => new("DatePickerFlyoutButtonOpacityPressed");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutButtonOpacityDisabled")]
public static ThemeResourceKey<double> Disabled => new("DatePickerFlyoutButtonOpacityDisabled");
}

[ResourceKeyDefinition(typeof(Thickness), "DatePickerFlyoutButtonPadding")]
public static ThemeResourceKey<Thickness> Padding => new("DatePickerFlyoutButtonPadding");
}

[ResourceKeyDefinition(typeof(Thickness), "DatePickerFlyoutButtonPadding")]
public static ThemeResourceKey<Thickness> ButtonPadding => new("DatePickerFlyoutButtonPadding");

[ResourceKeyDefinition(typeof(CornerRadius), "DatePickerFlyoutPresenterCornerRadius")]
public static ThemeResourceKey<CornerRadius> CornerRadius => new("DatePickerFlyoutPresenterCornerRadius");

Expand Down Expand Up @@ -160,8 +178,11 @@ public static class ButtonOpacity
[ResourceKeyDefinition(typeof(double), "DatePickerHeight")]
public static ThemeResourceKey<double> Height => new("DatePickerHeight");

[ResourceKeyDefinition(typeof(Brush), "DatePickerPlaceholderTextForeground")]
public static ThemeResourceKey<Brush> PlaceholderTextForeground => new("DatePickerPlaceholderTextForeground");
public static partial class PlaceholderTextForeground
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerPlaceholderTextForeground")]
public static ThemeResourceKey<Brush> Default => new("DatePickerPlaceholderTextForeground");
}
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/library/Uno.Themes.WinUI.Markup/Theme/PasswordBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ public static partial class LeadingIconForeground
[ResourceKeyDefinition(typeof(Thickness), "FilledPasswordBoxPadding")]
public static ThemeResourceKey<Thickness> Padding => new("FilledPasswordBoxPadding");

[ResourceKeyDefinition(typeof(Brush), "FilledPasswordBoxRevealButtonForeground")]
public static ThemeResourceKey<Brush> RevealButtonForeground => new("FilledPasswordBoxRevealButtonForeground");
public static partial class RevealButtonForeground
{
[ResourceKeyDefinition(typeof(Brush), "FilledPasswordBoxRevealButtonForeground")]
public static ThemeResourceKey<Brush> Default => new("FilledPasswordBoxRevealButtonForeground");
}
}

public static partial class Outlined
Expand Down
14 changes: 10 additions & 4 deletions src/library/Uno.Themes.WinUI.Markup/Theme/ProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ public static partial class Resources
{
public static partial class Default
{
[ResourceKeyDefinition(typeof(Brush), "ProgressBarBackground")]
public static ThemeResourceKey<Brush> Background => new("ProgressBarBackground");
public static partial class Background
{
[ResourceKeyDefinition(typeof(Brush), "ProgressBarBackground")]
public static ThemeResourceKey<Brush> Default => new("ProgressBarBackground");
}

[ResourceKeyDefinition(typeof(Brush), "ProgressBarForeground")]
public static ThemeResourceKey<Brush> Foreground => new("ProgressBarForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "ProgressBarForeground")]
public static ThemeResourceKey<Brush> Default => new("ProgressBarForeground");
}

[ResourceKeyDefinition(typeof(double), "ProgressBarHeight")]
public static ThemeResourceKey<double> Height => new("ProgressBarHeight");
Expand Down
14 changes: 10 additions & 4 deletions src/library/Uno.Themes.WinUI.Markup/Theme/ProgressRing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ public static partial class Resources
{
public static partial class Default
{
[ResourceKeyDefinition(typeof(Brush), "ProgressRingBackground")]
public static ThemeResourceKey<Brush> Background => new("ProgressRingBackground");
public static partial class Background
{
[ResourceKeyDefinition(typeof(Brush), "ProgressRingBackground")]
public static ThemeResourceKey<Brush> Default => new("ProgressRingBackground");
}

[ResourceKeyDefinition(typeof(Brush), "ProgressRingForeground")]
public static ThemeResourceKey<Brush> Foreground => new("ProgressRingForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "ProgressRingForeground")]
public static ThemeResourceKey<Brush> Default => new("ProgressRingForeground");
}
}
}

Expand Down
14 changes: 10 additions & 4 deletions src/library/Uno.Themes.WinUI.Markup/Theme/RatingControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ public static partial class Caption
[ResourceKeyDefinition(typeof(FontFamily), "RatingControlCaptionFontFamily")]
public static ThemeResourceKey<FontFamily> FontFamily => new("RatingControlCaptionFontFamily");

[ResourceKeyDefinition(typeof(Brush), "RatingControlCaptionForeground")]
public static ThemeResourceKey<Brush> Foreground => new("RatingControlCaptionForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "RatingControlCaptionForeground")]
public static ThemeResourceKey<Brush> Default => new("RatingControlCaptionForeground");
}

[ResourceKeyDefinition(typeof(double), "RatingControlCaptionHeight")]
public static ThemeResourceKey<double> Height => new("RatingControlCaptionHeight");
Expand Down Expand Up @@ -107,8 +110,11 @@ public static partial class Caption
[ResourceKeyDefinition(typeof(FontFamily), "SecondaryRatingControlCaptionFontFamily")]
public static ThemeResourceKey<FontFamily> FontFamily => new("SecondaryRatingControlCaptionFontFamily");

[ResourceKeyDefinition(typeof(Brush), "SecondaryRatingControlCaptionForeground")]
public static ThemeResourceKey<Brush> Foreground => new("SecondaryRatingControlCaptionForeground");
public static partial class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "SecondaryRatingControlCaptionForeground")]
public static ThemeResourceKey<Brush> Default => new("SecondaryRatingControlCaptionForeground");
}

[ResourceKeyDefinition(typeof(double), "SecondaryRatingControlCaptionHeight")]
public static ThemeResourceKey<double> Height => new("SecondaryRatingControlCaptionHeight");
Expand Down
Loading

0 comments on commit e2b11e4

Please sign in to comment.