Skip to content

Commit

Permalink
Remove hover effect from HyperlinkButton
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-lerch committed Jul 29, 2024
1 parent aad8f43 commit b1693e6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.1.0</AvaloniaVersion>
<AvaloniaVersion>11.1.1</AvaloniaVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Vocup.WinForms/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static void Main(string[] args)
splash.Show();
Application.DoEvents();

AppBuilder.Configure<App>().UseWin32().UseSkia().UseReactiveUI().SetupWithoutStarting();
AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI().SetupWithoutStarting();

var serviceScope = InitializeServices();

Expand Down
2 changes: 1 addition & 1 deletion src/Vocup.WinForms/Vocup.WinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<Content Include="icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Skia" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Win32.Interoperability" Version="$(AvaloniaVersion)" />
<PackageReference Include="CsvHelper" Version="31.0.3" />
<PackageReference Include="LostTech.App.Settings" Version="0.5.0" />
Expand Down
16 changes: 14 additions & 2 deletions src/Vocup/ViewModels/LicensesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ public LicensesViewModel()
public Interaction<Uri, bool> LaunchUri { get; } = new();

public List<Component> Components { get; } = [
new()
{
Name = ".NET",
License = "MIT",
Url = "https://dotnet.microsoft.com",
},
new()
{
Name = "Avalonia",
License = "",
Url = "https://avaloniaui.net"
License = "MIT",
Url = "https://avaloniaui.net",
},
new()
{
Expand All @@ -51,6 +57,12 @@ public LicensesViewModel()
License = "CC BY-ND 3.0",
Url = "https://icons8.com/icons/office",
},
new()
{
Name = "ReactiveUI",
License = "MIT",
Url = "https://reactiveui.net",
},
];

public class Component
Expand Down
14 changes: 9 additions & 5 deletions src/Vocup/Views/LicensesControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,26 @@
<Setter Property="CornerRadius" Value="0" />
<Setter Property="Padding" Value="0" />
</Style>
<Style Selector="HyperlinkButton.link:pointerover">
<Style Selector="HyperlinkButton.link:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
</Style>
</UserControl.Styles>

<ItemsControl ItemsSource="{Binding Components}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<HyperlinkButton Classes="link" Content="{Binding Name}" Command="{Binding #control.ViewModel.NavigateToUri}" CommandParameter="{Binding Url}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<HyperlinkButton Grid.Column="0" Classes="link" Content="{Binding Name}" Command="{Binding #control.ViewModel.NavigateToUri}" CommandParameter="{Binding Url}">
<ToolTip>
<TextBlock Text="{Binding Url}" />
</ToolTip>
</HyperlinkButton>
<TextBlock Text="{Binding License}" />
</StackPanel>
<TextBlock Grid.Column="1" Text="{Binding License}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Expand Down

0 comments on commit b1693e6

Please sign in to comment.