1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Fixed crash when text is selected and item gets moused over

This commit is contained in:
Brian Fiete 2020-04-20 14:54:50 -07:00
parent 33448603b1
commit 27d8f9df0f

View file

@ -188,14 +188,14 @@ namespace IDE.ui
mFilterString = null; mFilterString = null;
} }
bool mShowingDropdown; bool mIgnoreShowDropdown;
public override MenuWidget ShowDropdown() public override MenuWidget ShowDropdown()
{ {
if (mShowingDropdown) if (mIgnoreShowDropdown)
return null; return null;
mShowingDropdown = true; mIgnoreShowDropdown = true;
defer { mShowingDropdown = false; } defer { mIgnoreShowDropdown = false; }
/*var stopWatch = scope Stopwatch(); /*var stopWatch = scope Stopwatch();
stopWatch.Start();*/ stopWatch.Start();*/
@ -246,7 +246,12 @@ namespace IDE.ui
void SelectionChanged(int selIdx) void SelectionChanged(int selIdx)
{ {
if (mEditWidget.mEditWidgetContent.HasSelection()) if (mEditWidget.mEditWidgetContent.HasSelection())
{
bool prevIgnoreShowDropdown = mIgnoreShowDropdown;
mIgnoreShowDropdown = true;
mEditWidget.SetText(""); mEditWidget.SetText("");
mIgnoreShowDropdown = prevIgnoreShowDropdown;
}
} }
public override void MenuClosed() public override void MenuClosed()