mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use set hotkey function instead of setter
This commit is contained in:
parent
51917809b3
commit
4055e30538
2 changed files with 12 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ public record RegisteredHotkeyData
|
|||
/// <summary>
|
||||
/// <see cref="HotkeyModel"/> representation of this hotkey.
|
||||
/// </summary>
|
||||
public HotkeyModel Hotkey { get; set; }
|
||||
public HotkeyModel Hotkey { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// String key in the localization dictionary that represents this hotkey. For example, <c>ReloadPluginHotkey</c>,
|
||||
|
|
@ -233,6 +233,15 @@ public record RegisteredHotkeyData
|
|||
RemoveHotkey = removeHotkey;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the hotkey for this registered hotkey data.
|
||||
/// </summary>
|
||||
/// <param name="hotkey"></param>
|
||||
public void SetHotkey(HotkeyModel hotkey)
|
||||
{
|
||||
Hotkey = hotkey;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ internal static class HotKeyMapper
|
|||
{
|
||||
var hotkeyData = SearchRegisteredHotkeyData(metadata, globalPluginHotkey);
|
||||
RemoveHotkey(hotkeyData);
|
||||
hotkeyData.Hotkey = newHotkey;
|
||||
hotkeyData.SetHotkey(newHotkey);
|
||||
SetHotkey(hotkeyData);
|
||||
}
|
||||
else if (pluginHotkey is SearchWindowPluginHotkey)
|
||||
|
|
@ -591,7 +591,7 @@ internal static class HotKeyMapper
|
|||
RemoveHotkey(registeredHotkeyData);
|
||||
|
||||
// Update the hotkey string
|
||||
registeredHotkeyData.Hotkey = newHotkey;
|
||||
registeredHotkeyData.SetHotkey(newHotkey);
|
||||
|
||||
// Set the new hotkey
|
||||
SetHotkey(registeredHotkeyData);
|
||||
|
|
|
|||
Loading…
Reference in a new issue