From b4cc5f88ca1d01e7a37249438b5fb6093816b96e Mon Sep 17 00:00:00 2001 From: Daniel Freak Date: Mon, 27 Jul 2026 23:00:51 +0300 Subject: [PATCH] [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 --- Directory.Packages.props | 12 ++++++------ src/SharpEmu.GUI/ConsoleWindow.cs | 3 ++- src/SharpEmu.GUI/Localization.cs | 6 +++--- src/SharpEmu.GUI/MainWindow.axaml | 28 +++++++++++++++++++--------- src/SharpEmu.GUI/MainWindow.axaml.cs | 11 ++++++----- 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 404a1e9..267a07a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,10 +7,10 @@ SPDX-License-Identifier: GPL-2.0-or-later true - - - - + + + + @@ -23,8 +23,8 @@ SPDX-License-Identifier: GPL-2.0-or-later - - + + diff --git a/src/SharpEmu.GUI/ConsoleWindow.cs b/src/SharpEmu.GUI/ConsoleWindow.cs index aa17933..f378f07 100644 --- a/src/SharpEmu.GUI/ConsoleWindow.cs +++ b/src/SharpEmu.GUI/ConsoleWindow.cs @@ -6,6 +6,7 @@ using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Controls.Templates; using Avalonia.Data; +using Avalonia.Input.Platform; using Avalonia.Layout; using Avalonia.Media; using Avalonia.Platform; @@ -40,7 +41,7 @@ public sealed class ConsoleWindow : Window _searchBox = new TextBox { - Watermark = loc.Get("Console.SearchWatermark"), + PlaceholderText = loc.Get("Console.SearchWatermark"), Width = 320, Margin = new Thickness(0, 0, 12, 0), }; diff --git a/src/SharpEmu.GUI/Localization.cs b/src/SharpEmu.GUI/Localization.cs index c7aefa2..4db23b1 100644 --- a/src/SharpEmu.GUI/Localization.cs +++ b/src/SharpEmu.GUI/Localization.cs @@ -5,6 +5,8 @@ using System.Text.Json; namespace SharpEmu.GUI; +public sealed record LanguageInfo(string Code, string NativeName); + /// /// Loads UI strings for the launcher. Every language ships embedded in the /// assembly (see SharpEmu.GUI.csproj) so a release build is fully @@ -16,8 +18,6 @@ public sealed class Localization { public static Localization Instance { get; } = new(); - public sealed record LanguageInfo(string Code, string NativeName); - private const string EmbeddedResourcePrefix = "Languages."; private const string EmbeddedResourceSuffix = ".json"; @@ -242,7 +242,7 @@ public sealed class Localization result = loaded; return true; } - + private bool TryLoad(string code, string json) { if (TryLoad(json, out var dict)) diff --git a/src/SharpEmu.GUI/MainWindow.axaml b/src/SharpEmu.GUI/MainWindow.axaml index 6eb7bf1..9e59d23 100644 --- a/src/SharpEmu.GUI/MainWindow.axaml +++ b/src/SharpEmu.GUI/MainWindow.axaml @@ -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 - +