Skip to content

Commit

Permalink
feat(HyperlinkButton): lightweight styling for hyperlinkbutton
Browse files Browse the repository at this point in the history
  • Loading branch information
Arieldelossantos committed Sep 20, 2023
1 parent d19569b commit cee510a
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/library/Uno.Themes.WinUI.Markup/Theme.Styles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ public static class MenuFlyoutPresenter
public static ResourceValue<Style> Default => new("MenuFlyoutPresenterStyle");
}

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

[ResourceKeyDefinition(typeof(Style), "SecondaryHyperlinkButtonStyle", TargetType = typeof(HyperlinkButton))]
public static ResourceValue<Style> Secondary => new("SecondaryHyperlinkButtonStyle");
}

public static class ListViewItem
{
[ResourceKeyDefinition(typeof(Style), "ListViewItemStyle", TargetType = typeof(ListViewItem))]
Expand Down
96 changes: 96 additions & 0 deletions src/library/Uno.Themes.WinUI.Markup/Theme/HyperlinkButton.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
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 HyperlinkButton
{
public static class Resources
{
public static class Default
{
public static class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonForeground")]
public static ResourceValue<Brush> Default => new("HyperlinkButtonForeground", true);

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

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

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

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

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

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

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

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

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

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

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

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

public static class Typo
{
[ResourceKeyDefinition(typeof(FontFamily), "HyperlinkButtonFontFamily")]
public static ResourceValue<FontFamily> FontFamily => new("HyperlinkButtonFontFamily", true);

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

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

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

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

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

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

[ResourceKeyDefinition(typeof(Style), "SecondaryHyperlinkButtonStyle", TargetType = typeof(HyperlinkButton))]
public static ResourceValue<Style> Secondary => new("SecondaryHyperlinkButtonStyle");
}
}
}
}

0 comments on commit cee510a

Please sign in to comment.