Skip to content

Commit

Permalink
feat: add lightweight styling to DatePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
Arieldelossantos committed Jul 20, 2023
1 parent a702b03 commit bf6571e
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/library/Uno.Themes.WinUI.Markup/Theme.Styles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ public static class ContentDialog
public static ResourceValue<Style> Default => new("ContentDialogStyle");
}

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

public static class FlyoutPresenter
{
[ResourceKeyDefinition(typeof(Style), "FlyoutPresenterStyle", TargetType = typeof(FlyoutPresenter))]
Expand Down
157 changes: 157 additions & 0 deletions src/library/Uno.Themes.WinUI.Markup/Theme/DatePicker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
using System;
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 DatePicker
{
public static class Resources
{
public static class FlyoutButton
{
public static class Background
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutButtonBackground")]
public static ResourceValue<Brush> Default => new("DatePickerFlyoutButtonBackground", true);
}
}

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

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

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

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

public static class ContainerCornerRadius
{
[ResourceKeyDefinition(typeof(CornerRadius), "DatePickerFlyoutPresenterCornerRadius")]
public static ResourceValue<CornerRadius> Default => new("DatePickerFlyoutPresenterCornerRadius", true);
}

public static class FontSize
{
[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutPresenterFontSize")]
public static ResourceValue<double> Default => new("DatePickerFlyoutPresenterFontSize", true);
}

public static class PresenterFontFamily
{
[ResourceKeyDefinition(typeof(FontFamily), "DatePickerFlyoutPresenterFontFamily")]
public static ResourceValue<FontFamily> Default => new("DatePickerFlyoutPresenterFontFamily", true);
}
}

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

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

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

[ResourceKeyDefinition(typeof(Brush), "DatePickerButtonBackgroundDisabled")]
public static ResourceValue<Brush> Disabled => new("DatePickerButtonBackgroundDisabled", true);
}

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

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

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

[ResourceKeyDefinition(typeof(Brush), "DatePickerButtonForegroundDisabled")]
public static ResourceValue<Brush> Disabled => new("DatePickerButtonForegroundDisabled", true);
}

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

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

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

[ResourceKeyDefinition(typeof(Brush), "DatePickerButtonBorderBrushDisabled")]
public static ResourceValue<Brush> Disabled => new("DatePickerButtonBorderBrushDisabled", true);
}

public static class ContainerCornerRadius
{
[ResourceKeyDefinition(typeof(CornerRadius), "DatePickerFlyoutPresenterCornerRadius")]
public static ResourceValue<CornerRadius> Default => new("DatePickerFlyoutPresenterCornerRadius", true);
}
}

public static class ButtonDateText
{
public static class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerButtonDateTextForeground")]
public static ResourceValue<Brush> Default => new("DatePickerButtonDateTextForeground", true);

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

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

[ResourceKeyDefinition(typeof(Brush), "DatePickerButtonDateTextForegroundDisabled")]
public static ResourceValue<Brush> Disabled => new("DatePickerButtonDateTextForegroundDisabled", true);
}
}

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

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

0 comments on commit bf6571e

Please sign in to comment.