Add dark mode support

This commit is contained in:
Mbucari 2023-03-22 16:43:29 -06:00 committed by MBucari
parent 7289459170
commit fc6f494f0d
62 changed files with 1090 additions and 145 deletions

View file

@ -16,11 +16,7 @@ namespace LibationAvalonia.ViewModels
protected override Bitmap LoadImage(byte[] picture)
=> AvaloniaUtils.TryLoadImageOrDefault(picture, LibationFileManager.PictureSize._80x80);
protected override Bitmap GetResourceImage(string rescName)
{
//These images are assest, so assume they will never corrupt.
using var stream = App.OpenAsset(rescName + ".png");
return new Bitmap(stream);
}
//Button icons are handled by LiberateStatusButton
protected override Bitmap GetResourceImage(string rescName) => null;
}
}

View file

@ -0,0 +1,27 @@
using ReactiveUI;
namespace LibationAvalonia.ViewModels
{
public class LiberateStatusButtonViewModel : ViewModelBase
{
private bool isSeries;
private bool isError;
private bool isButtonEnabled;
private bool expanded;
private bool redVisible = true;
private bool yellowVisible;
private bool greenVisible;
private bool pdfNotDownloadedVisible;
private bool pdfDownloadedVisible;
public bool IsError { get => isError; set => this.RaiseAndSetIfChanged(ref isError, value); }
public bool IsButtonEnabled { get => isButtonEnabled; set => this.RaiseAndSetIfChanged(ref isButtonEnabled, value); }
public bool IsSeries { get => isSeries; set => this.RaiseAndSetIfChanged(ref isSeries, value); }
public bool Expanded { get => expanded; set => this.RaiseAndSetIfChanged(ref expanded, value); }
public bool RedVisible { get => redVisible; set => this.RaiseAndSetIfChanged(ref redVisible, value); }
public bool YellowVisible { get => yellowVisible; set => this.RaiseAndSetIfChanged(ref yellowVisible, value); }
public bool GreenVisible { get => greenVisible; set => this.RaiseAndSetIfChanged(ref greenVisible, value); }
public bool PdfDownloadedVisible { get => pdfDownloadedVisible; set => this.RaiseAndSetIfChanged(ref pdfDownloadedVisible, value); }
public bool PdfNotDownloadedVisible { get => pdfNotDownloadedVisible; set => this.RaiseAndSetIfChanged(ref pdfNotDownloadedVisible, value); }
}
}

View file

@ -134,8 +134,11 @@ namespace LibationAvalonia.ViewModels
set
{
this.RaiseAndSetIfChanged(ref _queueOpen, value);
QueueButtonAngle = value ? 180 : 0;
this.RaisePropertyChanged(nameof(QueueButtonAngle));
}
}
public double QueueButtonAngle { get; private set; }
/// <summary> The number of books visible in the Product Display </summary>