From 1eedaf979a8fb99f91a5130732e36a40b5405546 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 16 Oct 2025 01:23:17 +0100 Subject: [PATCH] [TUI] Add status bar. --- .../ViewModels/Windows/MainWindowViewModel.cs | 15 +- Aaru.Tui/Views/Windows/MainWindow.axaml | 268 +++++++++--------- 2 files changed, 151 insertions(+), 132 deletions(-) diff --git a/Aaru.Tui/ViewModels/Windows/MainWindowViewModel.cs b/Aaru.Tui/ViewModels/Windows/MainWindowViewModel.cs index 4c595177c..330c8d71e 100644 --- a/Aaru.Tui/ViewModels/Windows/MainWindowViewModel.cs +++ b/Aaru.Tui/ViewModels/Windows/MainWindowViewModel.cs @@ -29,7 +29,11 @@ public sealed partial class MainWindowViewModel : ViewModelBase ObservableCollection _files = []; [ObservableProperty] string _informationalVersion; + [ObservableProperty] + bool _isStatusVisible; FileModel? _selectedFile; + [ObservableProperty] + string _status; public MainWindowViewModel() { @@ -43,6 +47,7 @@ public sealed partial class MainWindowViewModel : ViewModelBase "?.?.?"; Copyright = Assembly.GetExecutingAssembly().GetCustomAttribute()?.Copyright ?? ""; + Status = "Loading..."; } public FileModel? SelectedFile @@ -89,7 +94,9 @@ public sealed partial class MainWindowViewModel : ViewModelBase public void LoadFiles() { - CurrentPath = Directory.GetCurrentDirectory(); + IsStatusVisible = true; + Status = "Loading..."; + CurrentPath = Directory.GetCurrentDirectory(); Files.Clear(); var parentDirectory = new FileModel @@ -141,6 +148,9 @@ public sealed partial class MainWindowViewModel : ViewModelBase void Worker() { + IsStatusVisible = true; + Status = "Loading file information..."; + foreach(FileModel file in Files) { try @@ -260,6 +270,9 @@ public sealed partial class MainWindowViewModel : ViewModelBase SentrySdk.CaptureException(ex); } } + + Status = "Done."; + IsStatusVisible = false; } void OpenSelectedFile() diff --git a/Aaru.Tui/Views/Windows/MainWindow.axaml b/Aaru.Tui/Views/Windows/MainWindow.axaml index 8bf048daf..ed8d5791f 100644 --- a/Aaru.Tui/Views/Windows/MainWindow.axaml +++ b/Aaru.Tui/Views/Windows/MainWindow.axaml @@ -20,141 +20,147 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +