mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-23 18:18:00 +02:00
Fixed duplicate hotkey issue with newly-added commands
This commit is contained in:
parent
adb7a2bdef
commit
a8b19b0d81
4 changed files with 61 additions and 29 deletions
|
@ -186,24 +186,6 @@ namespace IDE.ui
|
|||
category.Open(true, true);
|
||||
}
|
||||
|
||||
void CommandContextToString(IDECommand.ContextFlags contextFlags, String str)
|
||||
{
|
||||
bool isFirst = true;
|
||||
|
||||
void AddFlagStr(StringView flagStr)
|
||||
{
|
||||
if (isFirst)
|
||||
{
|
||||
str.Append(", ");
|
||||
isFirst = false;
|
||||
}
|
||||
str.Append(flagStr);
|
||||
}
|
||||
|
||||
if (contextFlags.HasFlag(.Editor))
|
||||
AddFlagStr("Editor");
|
||||
}
|
||||
|
||||
void UpdateKeyStates()
|
||||
{
|
||||
Debug.Assert((CategoryType)mPropPage.mCategoryType == .Keys);
|
||||
|
@ -223,7 +205,7 @@ namespace IDE.ui
|
|||
let keyEntryStr = new String();
|
||||
KeyState.ToString(keys, keyEntryStr);
|
||||
keyEntryStr.Append(" ");
|
||||
CommandContextToString(keyEntry.mContextFlags, keyEntryStr);
|
||||
keyEntry.mContextFlags.ContextToString(keyEntryStr);
|
||||
|
||||
String* keyPtr;
|
||||
KeyEntry* valuePtr;
|
||||
|
@ -253,7 +235,7 @@ namespace IDE.ui
|
|||
let keyEntryStr = scope String();
|
||||
KeyState.ToString(keys, keyEntryStr);
|
||||
keyEntryStr.Append(" ");
|
||||
CommandContextToString(keyEntry.mContextFlags, keyEntryStr);
|
||||
keyEntry.mContextFlags.ContextToString(keyEntryStr);
|
||||
|
||||
if (mappedEntries.TryGet(keyEntryStr, var keyPtr, var valuePtr))
|
||||
{
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace IDE.ui
|
|||
{
|
||||
if (keyEvent.mKeyCode == .Escape)
|
||||
{
|
||||
if (mPanel.mQuickFind.mWidgetWindow != null)
|
||||
if (mPanel.mQuickFind?.mWidgetWindow != null)
|
||||
{
|
||||
mPanel.mQuickFind.Close();
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue