Files
Libation/Source/LibationAvalonia/Views/LiberateStatusButton.axaml
T
Cursor Agentandrmcrackan dcaa42d21d Draw Avalonia Liberate icons from the shared generator
Replace the hand-composed vector layers with the shared rendering bound through
EntryStatus.ButtonImage, and delete the geometry and stoplight brushes that only
that composition used.

The rendering is per-theme rather than a set of DynamicResource brushes, so each
button re-renders its icon when the actual theme variant changes.

Co-authored-by: rmcrackan <rmcrackan@gmail.com>
2026-08-13 05:56:29 +00:00

34 lines
1.3 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:LibationAvalonia.ViewModels"
mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="200" MinWidth="37" MinHeight="40"
Background="Transparent"
x:DataType="vm:LiberateStatusButtonViewModel"
x:Class="LibationAvalonia.Views.LiberateStatusButton">
<UserControl.Styles>
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SystemChromeDisabledLowColor}" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemChromeDisabledLowColor}" />
</Style>
</UserControl.Styles>
<Button
Name="button"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Padding="0"
IsEnabled="{Binding IsButtonEnabled}" Click="Button_Click" >
<Grid RowDefinitions="*,8*,*">
<Image
Grid.Row="1"
Stretch="Uniform"
RenderOptions.BitmapInterpolationMode="HighQuality"
Source="{Binding ButtonImage}" />
</Grid>
</Button>
</UserControl>