Profile editor - Added back hotkeys for the tools

Profile editor - Fixed hotkeys not always working
This commit is contained in:
Robert committed 2023-10-07 20:12:35 +02:00
1 parent f985682e78
commit 543b62a715
16 files changed
+106 -38

No files matched your search

+9 -3
View File
@@ -22,10 +22,11 @@ public static class UI
static UI()
{
KeyBindingsEnabled = InputElement.GotFocusEvent.Raised.Select(e => e.Item2.Source is not TextBox).StartWith(true);
CurrentKeyBindingsEnabled = InputElement.GotFocusEvent.Raised.Select(e => e.Item2.Source is not TextBox).StartWith(true);
CurrentKeyBindingsEnabled.Subscribe(b => KeyBindingsEnabled = b);
MicaEnabled = MicaEnabledSubject.AsObservable();
}
/// <summary>
/// Gets the current IoC locator.
/// </summary>
@@ -36,10 +37,15 @@ public static class UI
/// </summary>
public static IClipboard Clipboard { get; set; } = null!;
/// <summary>
/// Gets an observable boolean indicating whether hotkeys are to be disabled.
/// </summary>
public static IObservable<bool> CurrentKeyBindingsEnabled { get; }
/// <summary>
/// Gets a boolean indicating whether hotkeys are to be disabled.
/// </summary>
public static IObservable<bool> KeyBindingsEnabled { get; }
public static bool KeyBindingsEnabled { get; private set; }
/// <summary>
/// Gets a boolean indicating whether the Mica effect should be enabled.