Keyboard panel handling WIP

This commit is contained in:
2023-02-15 21:38:05 +01:00
parent 97f5108ba8
commit 18cb769001
4 changed files with 69 additions and 9 deletions

View File

@@ -1,18 +1,24 @@
using System.Collections.ObjectModel;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using FileTime.App.Core.ViewModels;
using FileTime.App.Core.ViewModels.Timeline;
using FileTime.Core.Models;
using FileTime.GuiApp.Configuration;
using FileTime.GuiApp.Models;
using FileTime.GuiApp.ViewModels;
using MvvmGen;
namespace FileTime.GuiApp.CustomImpl.ViewModels;
[ViewModel(GenerateConstructor = false)]
public partial class GuiAppState : AppStateBase, IGuiAppState
public partial class GuiAppState : AppStateBase, IGuiAppState, IDisposable
{
private readonly BehaviorSubject<GuiPanel> _activePanel = new(GuiPanel.FileBrowser);
public GuiAppState(ITimelineViewModel timelineViewModel) : base(timelineViewModel)
{
ActivePanel = _activePanel.AsObservable();
}
[Property] private bool _isAllShortcutVisible;
@@ -27,4 +33,14 @@ public partial class GuiAppState : AppStateBase, IGuiAppState
public List<KeyConfig> PreviousKeys { get; } = new();
public ObservableCollection<string> PopupTexts { get; } = new();
}
public IObservable<GuiPanel> ActivePanel { get; }
public void SetActivePanel(GuiPanel newPanel)
=> _activePanel.OnNext(newPanel);
public void Dispose()
{
_activePanel.Dispose();
}
}