mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
use WPF Control hotkey display
This commit is contained in:
parent
be796fd899
commit
33d5a741e7
2 changed files with 3 additions and 4 deletions
|
|
@ -187,6 +187,7 @@ namespace Flow.Launcher.Infrastructure.Hotkey
|
|||
}
|
||||
}
|
||||
|
||||
// WPF Control hotkey form i.e. simplified text e.g. LeftAlt+X -> Alt + X, includes space around '+'
|
||||
public readonly string ToWPFHotkeyString()
|
||||
{
|
||||
var hotkey = string.Empty;
|
||||
|
|
@ -220,9 +221,9 @@ namespace Flow.Launcher.Infrastructure.Hotkey
|
|||
return hotkey;
|
||||
}
|
||||
|
||||
public IEnumerable<string> EnumerateDisplayKeys() => !string.IsNullOrEmpty(HotkeyRaw) ? HotkeyRaw.Split('+') : Array.Empty<string>();
|
||||
// Display in the form of WPF Control i.e. simplified text e.g. LeftAlt -> Alt
|
||||
public IEnumerable<string> EnumerateDisplayKeys() => !string.IsNullOrEmpty(HotkeyRaw) ? ToWPFHotkeyString().Split(" + ") : Array.Empty<string>();
|
||||
|
||||
//For WPF hotkey control
|
||||
public string FromWPFKeysToString() => string.Join("+", EnumerateWPFKeys());
|
||||
|
||||
public IEnumerable<string> EnumerateWPFKeys()
|
||||
|
|
|
|||
|
|
@ -161,8 +161,6 @@ public partial class HotkeyControlDialog : ContentDialog
|
|||
return;
|
||||
}
|
||||
|
||||
IEnumerable<string> enumerateMethod;
|
||||
|
||||
foreach (var key in hotkey.Value.EnumerateDisplayKeys()!)
|
||||
{
|
||||
KeysToDisplay.Add(key);
|
||||
|
|
|
|||
Loading…
Reference in a new issue