diff --git a/Source/LibationAvalonia/App.axaml b/Source/LibationAvalonia/App.axaml index e2105c99..ceb34c03 100644 --- a/Source/LibationAvalonia/App.axaml +++ b/Source/LibationAvalonia/App.axaml @@ -31,9 +31,6 @@ - - - @@ -44,9 +41,6 @@ - - - diff --git a/Source/LibationAvalonia/Assets/LibationVectorIcons.xaml b/Source/LibationAvalonia/Assets/LibationVectorIcons.xaml index ef0fb4f0..5d639d16 100644 --- a/Source/LibationAvalonia/Assets/LibationVectorIcons.xaml +++ b/Source/LibationAvalonia/Assets/LibationVectorIcons.xaml @@ -11,7 +11,6 @@ M31,0 H49 V100 H31 M58,0 H76 V100 H58 M85,0 H103 V100 H85 M8,85 V122 H129 V85 H117 V109 H20 V85 H8 M0,36 V66 L24,51 M114,36 V66 L138,51 M0,0 H100 V100 H0 V0 M2,50 L36,82 L 93,27 L81,15 L36,59 L14,38 M0,0 H100 V100 H0 V0 M15,71 L29,85 L50,64 L71,85 L85,71 L64,50 L85,29 L71,15 L50,36 L29,15 L15,29 L36,50 - M32,0 a 32,32 0 0 1 0,64 a 32,32 0 0 1 0,-64 m 0,4 a 28,28 0 0 1 0,56 a 28,28 0 0 1 0,-56 m-21,24 h42 a 1,1 0 0 1 1,1 v6 a 1,1 0 0 1 -1,1 h-42 a 1,1 0 0 1 -1,-1 v-6 a 1,1 0 0 1 1,-1 @@ -23,40 +22,6 @@ M 78,6 L81.5,2.5 A 8,8 0 0 1 91.5,2 L98.5,9 A 8,8 0 0 1 97.5,19.5 L94,23 - - M0,2 A 2,2 0 0 1 2,0 H62 A2,2 0 0 1 64,2 V62 A 2,2 0 0 1 62,64 H 2 A 2,2 0 0 1 0,62 V2 - M 2,2 H62 V62 H2 V2 - M11,28 h42 a 1,1 0 0 1 1,1 v6 a 1,1 0 0 1 -1,1 h-42 a 1,1 0 0 1 -1,-1 v-6 a 1,1 0 0 1 1,-1 - - M28,53 v-42 a 1,1 0 0 1 1,-1 h6 a 1,1 0 0 1 1,1 v42 a 1,1 0 0 1 -1,1 h-6 a 1,1 0 0 1 -1,-1 - - - - - - M0,12 A 12,12 0 0 1 12,0 H34 A 12,12 0 0 1 46,12 V88 A 12,12 0 0 1 34,100 H12 A 12,12 0 0 1 0,88 V12 - M20,8 H26 A 12,12 0 0 1 26,32 H20 A 12,12 0 0 1 20,8 - M20,38 H26 A 12,12 0 0 1 26,62 H20 A 12,12 0 0 1 20,38 - M20,68 H26 A 12,12 0 0 1 26,92 H20 A 12,12 0 0 1 20,68 - - - - M4,38.5 H3 A 3,3 0 0 1 0,35.5 V21.4 A 3,3 0 0 1 3,18.4 H4 V2 A 2,2 0 0 1 6,0 H30.5 L41,12 V18.4 A 3,3 0 0 1 45,21.4 V35.5 A 3,3 0 0 1 42,38.5 H41 V48.5 A 2,2 0 0 1 39,50.5 H6 A 2,2 0 0 1 4,48.5 - M6,38.5 H39 V48.5 H6 V38.5 - M6,18.4 V2 H29 V12 A 1,1 0 0 0 30,13 H39 V18.4 - M 4.3179,36 c 0,0 0.122,-14.969 0.122,-14.969 1.469,-0.194 2.939,-0.388 4.5,-0.362 1.561,0.026 3.214,0.27 4.357,0.944 1.143,0.674 1.775,1.776 2.015,2.959 0.24,1.184 0.087,2.449 -0.5,3.52 -0.587,1.071 -1.607,1.949 -2.816,2.352 -1.209,0.403 -2.607,0.332 -4.005,0.26 0,0 -0.031,5.265 -0.031,5.265 0,0 -3.673,0.122 -3.673,0.122 0,0 0.031,-0.092 0.031,-0.092 - m 3.643,-12.428 c 0,0 0.031,4.286 0.031,4.286 0.735,0.051 1.47,0.102 2.107,-0.056 0.638,-0.158 1.178,-0.526 1.459,-1.122 0.281,-0.597 0.301,-1.423 0.01,-2.005 -0.291,-0.582 -0.893,-0.918 -1.546,-1.061 -0.653,-0.143 -1.357,-0.092 -1.709,-0.066 -0.352,0.026 -0.352,0.026 -0.352,0.026 - m 9.428,12.428 c 2.265,0.245 4.531,0.49 6.674,0.066 2.143,-0.424 4.163,-1.515 5.285,-3.081 1.122,-1.566 1.347,-3.607 1.27,-5.306 -0.076,-1.699 -0.454,-3.056 -1.454,-4.219 -1,-1.163 -2.622,-2.133 -4.704,-2.505 -2.082,-0.373 -4.623,-0.148 -7.164,0.076 0,0 0.092,14.969 0.092,14.969 - m 3.49,-12.398 c 0,0 0,9.673 0,9.673 0.888,0.02 1.776,0.041 2.653,-0.179 0.877,-0.219 1.745,-0.679 2.367,-1.541 0.622,-0.862 1,-2.127 0.98,-3.403 -0.02,-1.275 -0.439,-2.561 -1.193,-3.337 -0.755,-0.776 -1.847,-1.041 -2.704,-1.158 -0.857,-0.117 -1.48,-0.087 -2.102,-0.056 - m 11.908,12.245 v-14.785 h8.969 v2.51 h-5.786 v3.612 h5.388 v2.51 h-5.449 v6.092 - - - - M29,44 V58.7498 H35.0491 A 1.5,1.5 0 0 1 36.1342,61.2861 L23.5607,73.8595 A 1.5,1.5 0 0 1 21.4393,73.8595 L8.8658,61.2861 A 1.5,1.5 0 0 1 9.9509,58.7498 H16 V44 A 1.5,1.5 0 0 1 17.5,42.5 H27.5 A 1.5,1.5 0 0 1 29,44 - - - - M5.65,4.3 h-2.75 a2.9,2.25 0 0 0 -2.9,2.25 v7.2 a2.9,2.25 0 0 0 2.9,2.25 h10.2 a2.9,2.25 0 0 0 2.9,-2.25 v-7.2 a2.9,2.25 0 0 0 -2.9,-2.25 diff --git a/Source/LibationAvalonia/ViewModels/LiberateStatusButtonViewModel.cs b/Source/LibationAvalonia/ViewModels/LiberateStatusButtonViewModel.cs index dee8f47d..aa405371 100644 --- a/Source/LibationAvalonia/ViewModels/LiberateStatusButtonViewModel.cs +++ b/Source/LibationAvalonia/ViewModels/LiberateStatusButtonViewModel.cs @@ -1,16 +1,10 @@ -using ReactiveUI; +using Avalonia.Media; +using ReactiveUI; namespace LibationAvalonia.ViewModels; public class LiberateStatusButtonViewModel : ViewModelBase { - public bool IsError { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } public bool IsButtonEnabled { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } - public bool IsSeries { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } - public bool Expanded { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } - public bool RedVisible { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } = true; - public bool YellowVisible { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } - public bool GreenVisible { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } - public bool PdfDownloadedVisible { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } - public bool PdfNotDownloadedVisible { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } + public IImage? ButtonImage { get => field; set => this.RaiseAndSetIfChanged(ref field, value); } } diff --git a/Source/LibationAvalonia/ViewModels/MainVM._NoUI.cs b/Source/LibationAvalonia/ViewModels/MainVM._NoUI.cs index fc5ea113..23f1eea8 100644 --- a/Source/LibationAvalonia/ViewModels/MainVM._NoUI.cs +++ b/Source/LibationAvalonia/ViewModels/MainVM._NoUI.cs @@ -1,6 +1,6 @@ -using LibationFileManager; +using Avalonia.Styling; +using LibationFileManager; using LibationUiBase; -using System; using System.IO; namespace LibationAvalonia.ViewModels; @@ -23,19 +23,6 @@ partial class MainVM PictureStorage.SetDefaultImage(PictureSize.Native, ms3.ToArray()); BaseUtil.SetLoadImageDelegate(AvaloniaUtils.TryLoadImageOrDefault); - BaseUtil.SetLoadResourceImageDelegate(LoadResourceImage); - } - private static Avalonia.Media.Imaging.Bitmap? LoadResourceImage(string resourceName) - { - try - { - using var stream = App.OpenAsset(resourceName); - return new Avalonia.Media.Imaging.Bitmap(stream); - } - catch (Exception ex) - { - Serilog.Log.Error(ex, "Failed to load resource image: {ResourceName}", resourceName); - return null; - } + BaseUtil.SetIsDarkModeDelegate(() => App.Current.ActualThemeVariant == ThemeVariant.Dark); } } diff --git a/Source/LibationAvalonia/Views/LiberateStatusButton.axaml b/Source/LibationAvalonia/Views/LiberateStatusButton.axaml index 701e87ff..241b5271 100644 --- a/Source/LibationAvalonia/Views/LiberateStatusButton.axaml +++ b/Source/LibationAvalonia/Views/LiberateStatusButton.axaml @@ -9,22 +9,6 @@ x:Class="LibationAvalonia.Views.LiberateStatusButton"> - - - - -