LANCommander/LANCommander.Launcher/Views/Components/CoverButton.axaml

136 lines
6.2 KiB
Text
Raw Permalink Normal View History

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vmComponents="using:LANCommander.Launcher.ViewModels.Components"
xmlns:local="using:LANCommander.Launcher.Views.Components"
x:Class="LANCommander.Launcher.Views.Components.CoverButton"
x:DataType="vmComponents:GameItemViewModel"
ClipToBounds="False">
<UserControl.Styles>
2026-04-04 17:53:26 -05:00
<Style Selector="Button.CoverButton">
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="RenderTransform" Value="scale(1)" />
<Setter Property="Transitions">
<Setter.Value>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.18" Easing="CubicEaseOut" />
</Transitions>
</Setter.Value>
</Setter>
</Style>
2026-04-04 17:53:26 -05:00
<Style Selector="Button.CoverButton:pointerover">
<Setter Property="RenderTransform" Value="scale(1.1)" />
</Style>
2026-04-04 17:53:26 -05:00
<Style Selector="Button.CoverButton Border.CoverShadow">
<Setter Property="BoxShadow" Value="0 0 64 32 #FF000000" />
<Setter Property="Opacity" Value="0" />
<Setter Property="Transitions">
<Setter.Value>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.18" />
</Transitions>
</Setter.Value>
</Setter>
</Style>
2026-04-04 17:53:26 -05:00
<Style Selector="Button.CoverButton:pointerover Border.CoverShadow">
<Setter Property="Opacity" Value="1" />
</Style>
2026-04-04 17:53:26 -05:00
<Style Selector="Button.CoverButton Border.GlassOverlay">
<Setter Property="Opacity" Value="0" />
<Setter Property="Transitions">
<Setter.Value>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
</Transitions>
</Setter.Value>
</Setter>
</Style>
2026-04-04 17:53:26 -05:00
<Style Selector="Button.CoverButton:pointerover Border.GlassOverlay">
<Setter Property="Opacity" Value="1" />
</Style>
2026-05-26 00:14:13 -05:00
<!-- Keyboard/gamepad focus: same visual treatment as hover -->
<Style Selector="Button.CoverButton:focus-visible">
<Setter Property="RenderTransform" Value="scale(1.1)" />
</Style>
<Style Selector="Button.CoverButton:focus-visible Border.CoverShadow">
<Setter Property="Opacity" Value="1" />
</Style>
<Style Selector="Button.CoverButton:focus-visible Border.GlassOverlay">
<Setter Property="Opacity" Value="1" />
</Style>
<Style Selector="Button.CoverButton Border.FocusRing">
<Setter Property="Opacity" Value="0" />
<Setter Property="Transitions">
<Setter.Value>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.15" />
</Transitions>
</Setter.Value>
</Setter>
</Style>
<Style Selector="Button.CoverButton:focus-visible Border.FocusRing">
<Setter Property="Opacity" Value="1" />
</Style>
</UserControl.Styles>
2026-04-04 17:53:26 -05:00
<Button Classes="CoverButton"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ClipToBounds="False"
Command="{Binding $parent[local:CoverButton].Command}"
CommandParameter="{Binding $parent[local:CoverButton].CommandParameter}">
<Panel>
2026-04-04 17:53:26 -05:00
<Border Classes="CoverShadow"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
IsHitTestVisible="False" />
2026-04-19 12:55:23 -05:00
<local:Cover x:Name="CoverControl"
Source="{Binding CoverPath}"
MimeType="{Binding CoverMimeType}"
2026-04-19 12:55:23 -05:00
Title="{Binding Title}"
HorizontalAlignment="Stretch"
2026-05-24 15:05:29 -05:00
VerticalAlignment="Stretch"
IsHitTestVisible="False">
2026-04-19 12:55:23 -05:00
<local:Cover.Overlay>
2026-05-24 15:05:29 -05:00
<Panel IsHitTestVisible="False">
<Border Classes="GlassOverlay" CornerRadius="0" IsHitTestVisible="False">
2026-04-19 12:55:23 -05:00
<Border.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="70%,100%">
<GradientStop Color="#45FFFFFF" Offset="0" />
<GradientStop Color="#10FFFFFF" Offset="0.45" />
<GradientStop Color="#00FFFFFF" Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
<Border Background="#CC000000" CornerRadius="0"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="16" Height="16"
Margin="6"
IsVisible="{Binding ShowInLibraryBadge}">
<Icon Type="Regular" Value="Check" Width="9" Height="9"
VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
</Panel>
</local:Cover.Overlay>
</local:Cover>
2026-05-26 00:14:13 -05:00
<Border Classes="FocusRing"
BorderBrush="#994096FF"
BorderThickness="2"
CornerRadius="4"
IsHitTestVisible="False"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
</Panel>
</Button>
</UserControl>