Skip to content

Commit e32538d

Browse files
committed
Use ui:HyperlinkButton instead of Button & Hyperlink in about page
1 parent f9e40ce commit e32538d

File tree

1 file changed

+53
-8
lines changed

1 file changed

+53
-8
lines changed

Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,54 @@
1616
<ui:Page.Resources>
1717
<ResourceDictionary>
1818
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}" />
19+
<Style x:Key="AccentHyperLinkButtonStyle" TargetType="ui:HyperlinkButton">
20+
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForeground}" />
21+
<Setter Property="Background" Value="{DynamicResource AccentButtonBackground}" />
22+
<Setter Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrush}" />
23+
<Setter Property="Template">
24+
<Setter.Value>
25+
<ControlTemplate TargetType="ui:HyperlinkButton">
26+
<Border
27+
x:Name="Background"
28+
Background="{TemplateBinding Background}"
29+
BorderBrush="{TemplateBinding BorderBrush}"
30+
BorderThickness="{TemplateBinding BorderThickness}"
31+
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
32+
SnapsToDevicePixels="True">
33+
<Border
34+
x:Name="Border"
35+
Padding="{TemplateBinding Padding}"
36+
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
37+
<ui:ContentPresenterEx
38+
x:Name="ContentPresenter"
39+
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
40+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
41+
Focusable="False"
42+
RecognizesAccessKey="True"
43+
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
44+
</Border>
45+
</Border>
46+
<ControlTemplate.Triggers>
47+
<Trigger Property="IsMouseOver" Value="True">
48+
<Setter TargetName="Background" Property="Background" Value="{DynamicResource AccentButtonBackgroundPointerOver}" />
49+
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrushPointerOver}" />
50+
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForegroundPointerOver}" />
51+
</Trigger>
52+
<Trigger Property="IsPressed" Value="True">
53+
<Setter TargetName="Background" Property="Background" Value="{DynamicResource AccentButtonBackgroundPressed}" />
54+
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrushPressed}" />
55+
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForegroundPressed}" />
56+
</Trigger>
57+
<Trigger Property="IsEnabled" Value="False">
58+
<Setter TargetName="Background" Property="Background" Value="{DynamicResource AccentButtonBackgroundDisabled}" />
59+
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrushDisabled}" />
60+
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForegroundDisabled}" />
61+
</Trigger>
62+
</ControlTemplate.Triggers>
63+
</ControlTemplate>
64+
</Setter.Value>
65+
</Setter>
66+
</Style>
1967
</ResourceDictionary>
2068
</ui:Page.Resources>
2169
<ui:ScrollViewerEx
@@ -40,14 +88,11 @@
4088
x:Name="UpdateAppButton"
4189
Command="{Binding UpdateAppCommand}"
4290
Content="{DynamicResource checkUpdates}" />
43-
<Button Height="{Binding ElementName=UpdateAppButton, Path=ActualHeight}" Style="{StaticResource AccentButtonStyle}">
44-
<Hyperlink
45-
NavigateUri="{Binding SponsorPage}"
46-
RequestNavigate="OnRequestNavigate"
47-
TextDecorations="None">
48-
<TextBlock Foreground="{StaticResource SystemControlForegroundAltHighBrush}" Text="{DynamicResource BecomeASponsor}" />
49-
</Hyperlink>
50-
</Button>
91+
<ui:HyperlinkButton
92+
Height="{Binding ElementName=UpdateAppButton, Path=ActualHeight}"
93+
Content="{DynamicResource BecomeASponsor}"
94+
NavigateUri="{Binding SponsorPage}"
95+
Style="{DynamicResource AccentHyperLinkButtonStyle}" />
5196
</ikw:SimpleStackPanel>
5297
</ui:SettingsCard>
5398

0 commit comments

Comments
 (0)