From c1ef5d438bc7efad2666af75e3b25c03edf6ec28 Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Wed, 20 May 2026 20:17:52 +0800 Subject: [PATCH 1/2] refactor: use SVG path icons for theme and locale buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace emoji with PathGeometry icons (Sun/Moon/Globe) - Theme: Moon icon in light mode, Sun icon in dark mode (toggled via IsDarkTheme) - Locale: Globe icon overlay with EN/δΈ­ text label - Remove ThemeButtonText emoji property from ViewModel --- src/ViewModels/MainWindowViewModel.cs | 2 - src/Views/MainWindow.axaml | 67 +++++++++++++++++++++++---- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/src/ViewModels/MainWindowViewModel.cs b/src/ViewModels/MainWindowViewModel.cs index 6fdab12..9cb57b0 100644 --- a/src/ViewModels/MainWindowViewModel.cs +++ b/src/ViewModels/MainWindowViewModel.cs @@ -12,7 +12,6 @@ public partial class MainWindowViewModel : ViewModelBase [ObservableProperty] private ViewModelBase _currentPage = new PatchViewModel(); [ObservableProperty] private bool _isDarkTheme; - [ObservableProperty] private string _themeButtonText = "πŸŒ™"; [ObservableProperty] private string _localeText = "EN"; public ObservableCollection NavItems { get; } = new(); @@ -54,7 +53,6 @@ [RelayCommand] private void Navigate(NavItem item) private void ToggleTheme() { IsDarkTheme = !IsDarkTheme; - ThemeButtonText = IsDarkTheme ? "β˜€οΈ" : "πŸŒ™"; var app = Avalonia.Application.Current; if (app != null) app.RequestedThemeVariant = IsDarkTheme diff --git a/src/Views/MainWindow.axaml b/src/Views/MainWindow.axaml index 5d93599..353e497 100644 --- a/src/Views/MainWindow.axaml +++ b/src/Views/MainWindow.axaml @@ -8,6 +8,34 @@ Title="{Binding Source={x:Static svc:LocalizationService.Instance}, Path=[App.Title]}" Width="960" Height="640" MinWidth="780" MinHeight="540" WindowStartupLocation="CenterScreen"> + + + + + M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41M12 6a6 6 0 100 12 6 6 0 000-12z + + + + + M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z + + + + + M12 2a10 10 0 100 20 10 10 0 000-20zm-2 18.41A8.04 8.04 0 015.05 13H7.1a16.1 16.1 0 002.9 7.41zM12 20a14.2 14.2 0 01-2.7-7h5.4A14.2 14.2 0 0112 20zm-4.9-9A8.04 8.04 0 0110 3.59 8.04 8.04 0 015.05 11H7.1zm9.8 0h2.05a8.04 8.04 0 00-4.95-7.41A16.1 16.1 0 0116.9 11zm2.05 2h-2.05a16.1 16.1 0 01-2.9 7.41A8.04 8.04 0 0018.95 13zm-11.85 0a8.04 8.04 0 004.95 7.41A16.1 16.1 0 017.1 13z + + + + + + + + + + + + @@ -38,16 +66,39 @@ - + + + From c1ff79bb5567df8337e195a43b145f3d1c550989 Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Wed, 20 May 2026 20:36:12 +0800 Subject: [PATCH 2/2] fix: Config.OutputPath overwritten with .zip path causing second build failure - After first build, OutputPath was set to the .zip file path - Second build used it as a directory, creating a broken path - Fix: don't overwrite OutputPath with .zip, keep it as directory only --- src/ViewModels/PatchViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ViewModels/PatchViewModel.cs b/src/ViewModels/PatchViewModel.cs index 8a57b66..9c10ca2 100644 --- a/src/ViewModels/PatchViewModel.cs +++ b/src/ViewModels/PatchViewModel.cs @@ -55,7 +55,7 @@ [RelayCommand] async Task Build() L(_loc.T("Patch.Packing", Path.GetFileName(zip))); await _pkg.CompressDirectoryAsync(tmp, zip); Directory.Delete(tmp, true); - Progress = 100; Config.OutputPath = zip; + Progress = 100; Status = _loc.T("Patch.Success", Path.GetFileName(zip), new FileInfo(zip).Length / 1024.0); L(Status); }