[GUI] Upgrade Avalonia to 12.1.0 and enable compiled bindings (#666)

* [GUI] bump to avalonia 12

* [GUI] add compiled bindings for cards/console logs/game metas

* [GUI] enable compiled bindings across launcher XAML
This commit is contained in:
Daniel Freak
2026-07-27 23:00:51 +03:00
committed by GitHub
parent db4339f698
commit b4cc5f88ca
5 changed files with 36 additions and 24 deletions
+19 -9
View File
@@ -15,7 +15,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
WindowStartupLocation="CenterScreen"
Background="{StaticResource BgBrush}"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="PreferSystemChrome"
WindowDecorations="Full"
ExtendClientAreaTitleBarHeightHint="44"
Icon="avares://SharpEmu.GUI/Assets/SharpEmu.ico"
KeyDown="OnKeyDown">
@@ -84,7 +84,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
<StackPanel Grid.Column="2" x:Name="LibraryToolbar" Orientation="Horizontal" Spacing="8"
VerticalAlignment="Center">
<TextBox x:Name="SearchBox" Watermark="Search library…" Width="240" VerticalAlignment="Center" />
<TextBox x:Name="SearchBox" PlaceholderText="Search library…" Width="240" VerticalAlignment="Center" />
<Button x:Name="AddFolderButton" Classes="ghost" Content=" Add folder" VerticalAlignment="Center" />
<Button x:Name="RescanButton" Classes="ghost" Content="⟳ Rescan" VerticalAlignment="Center" />
<Button x:Name="OpenFileButton" Classes="ghost" Content="Open file…" VerticalAlignment="Center" />
@@ -148,7 +148,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate x:DataType="local:GameEntry" x:CompileBindings="True">
<StackPanel Width="128" Height="172" Spacing="7">
<Border Classes="coverShadow" Width="128" Height="128">
<Border Classes="coverClip">
@@ -273,8 +273,13 @@ SPDX-License-Identifier: GPL-2.0-or-later
<local:SettingRow x:Name="LanguageRow" Label="Emulator language"
Description="Language used throughout the launcher. Applies immediately.">
<ComboBox x:Name="LanguageBox" Width="160"
VerticalAlignment="Center" CornerRadius="8"
DisplayMemberBinding="{Binding NativeName}" />
VerticalAlignment="Center" CornerRadius="8">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="local:LanguageInfo">
<TextBlock Text="{Binding NativeName}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</local:SettingRow>
<local:SettingRow x:Name="TitleMusicRow" Label="Title music"
@@ -498,7 +503,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
<Grid Grid.Row="0" ColumnDefinitions="*,Auto,Auto,Auto,Auto,Auto" Margin="16,12,16,8">
<TextBlock x:Name="ConsoleSectionTitle" Classes="sectionTitle" Text="CONSOLE" VerticalAlignment="Center" />
<TextBox Grid.Column="1" FontSize="12" Margin="0,0,12,0" x:Name="ConsoleSearchBox"
Watermark="Search..." Width="320" />
PlaceholderText="Search..." Width="320" />
<CheckBox Grid.Column="2" x:Name="AutoScrollCheck" Content="Auto-scroll" IsChecked="True"
FontSize="12" Margin="0,0,12,0" />
<Button Grid.Column="3" x:Name="DetachConsoleButton" Classes="ghost" Content="Split" FontSize="12"
@@ -511,7 +516,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
<ListBox Grid.Row="1" x:Name="ConsoleList" Classes="console" BorderThickness="0,1,0,0"
BorderBrush="{StaticResource CardBorderBrush}" CornerRadius="0,0,12,12">
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate x:DataType="local:LogLine" x:CompileBindings="True">
<TextBlock Text="{Binding Text}" Foreground="{Binding Brush}" TextWrapping="NoWrap" />
</DataTemplate>
</ListBox.ItemTemplate>
@@ -527,7 +532,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
<!-- Selected game cover thumbnail -->
<Border Grid.Column="0" Classes="coverClip" Width="56" Height="56" CornerRadius="8"
VerticalAlignment="Center">
<Panel x:Name="SelectedCoverPanel">
<Panel x:Name="SelectedCoverPanel"
x:DataType="local:GameEntry"
x:CompileBindings="True">
<Border Background="{Binding PlaceholderBrush, FallbackValue={x:Null}}"
IsVisible="{Binding !HasCover, FallbackValue=False}">
<TextBlock Text="{Binding Initials}" FontSize="20" FontWeight="Bold"
@@ -548,7 +555,10 @@ SPDX-License-Identifier: GPL-2.0-or-later
<!-- Title id / version / size badges, right next to the
title. The title's own MaxWidth (not a "*" column) is
what keeps them from drifting to the far right. -->
<StackPanel Grid.Column="1" x:Name="SelectedBadgesRow" Orientation="Horizontal" Spacing="6"
<StackPanel Grid.Column="1" x:Name="SelectedBadgesRow"
x:DataType="local:GameEntry"
x:CompileBindings="True"
Orientation="Horizontal" Spacing="6"
IsVisible="False" VerticalAlignment="Center">
<Border Classes="pill" IsVisible="{Binding HasTitleId, FallbackValue=False}">
<TextBlock Text="{Binding TitleId}" FontSize="10" FontWeight="SemiBold"