Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add lightweight styling to DatePicker #1061

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -38,12 +38,6 @@ public static class ContentDialog
public static StaticResourceKey<Style> Default => new("ContentDialogStyle");
}

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

public static class FlyoutPresenter
{
[ResourceKeyDefinition(typeof(Style), "FlyoutPresenterStyle", TargetType = typeof(FlyoutPresenter))]
Expand Down
200 changes: 200 additions & 0 deletions src/library/Uno.Themes.WinUI.Markup/Theme/DatePicker.cs
kazo0 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
using System;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup;
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 Flyout
{
public static class Background
{
[ResourceKeyDefinition(typeof(Brush), "DatePickerFlyoutPresenterBackground")]
public static ThemeResourceKey<Brush> Default => new("DatePickerFlyoutPresenterBackground");
}

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

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

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

public static class Typography
{
[ResourceKeyDefinition(typeof(FontFamily), "DatePickerFlyoutPresenterFontFamily")]
public static ThemeResourceKey<FontFamily> FontFamily => new("DatePickerFlyoutPresenterFontFamily");

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

public static class Button
{
public static 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(CornerRadius), "DatePickerFlyoutPresenterCornerRadius")]
public static ThemeResourceKey<CornerRadius> CornerRadius => new("DatePickerFlyoutPresenterCornerRadius");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutBorderThickness")]
public static ThemeResourceKey<double> BorderThickness => new("DatePickerFlyoutBorderThickness");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutElevation")]
public static ThemeResourceKey<double> Elevation => new("DatePickerFlyoutElevation");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutPresenterWidth")]
public static ThemeResourceKey<double> Width => new("DatePickerFlyoutPresenterWidth");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutPresenterMinWidth")]
public static ThemeResourceKey<double> MinWidth => new("DatePickerFlyoutPresenterMinWidth");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutPresenterMaxHeight")]
public static ThemeResourceKey<double> MaxHeight => new("DatePickerFlyoutPresenterMaxHeight");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutPresenterAcceptDismissHostGridHeight")]
public static ThemeResourceKey<double> AcceptDismissHostGridHeight => new("DatePickerFlyoutPresenterAcceptDismissHostGridHeight");

[ResourceKeyDefinition(typeof(double), "DatePickerFlyoutPresenterHighlightHeight")]
public static ThemeResourceKey<double> HighlightHeight => new("DatePickerFlyoutPresenterHighlightHeight");


}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[ResourceKeyDefinition(typeof(double), "DatePickerButtonBottomBorderHeight")]
public static ThemeResourceKey<double> BottomBorderHeight => new("DatePickerButtonBottomBorderHeight");

[ResourceKeyDefinition(typeof(double), "DatePickerButtonContentHeight")]
public static ThemeResourceKey<double> ContentHeight => new("DatePickerButtonContentHeight");

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

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

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

}

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

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

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

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