mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed focus issue with popup error
This commit is contained in:
parent
25f44ae133
commit
7400e7099c
1 changed files with 21 additions and 3 deletions
|
@ -4465,8 +4465,26 @@ namespace IDE
|
||||||
ShowTab(panel, label, false, setFocus);
|
ShowTab(panel, label, false, setFocus);
|
||||||
if (setFocus)
|
if (setFocus)
|
||||||
panel.FocusForKeyboard();
|
panel.FocusForKeyboard();
|
||||||
|
|
||||||
if ((!panel.mWidgetWindow.mHasFocus) && (!mRunningTestScript))
|
if ((!panel.mWidgetWindow.mHasFocus) && (!mRunningTestScript))
|
||||||
panel.mWidgetWindow.SetForeground();
|
{
|
||||||
|
bool hasFocus = false;
|
||||||
|
BFWindow activeWindow = GetActiveWindow(true);
|
||||||
|
BFWindow checkWindow = activeWindow;
|
||||||
|
while (checkWindow != null)
|
||||||
|
{
|
||||||
|
if (checkWindow == panel.mWidgetWindow)
|
||||||
|
{
|
||||||
|
activeWindow.SetForeground();
|
||||||
|
hasFocus = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
checkWindow = checkWindow.mParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasFocus)
|
||||||
|
panel.mWidgetWindow.SetForeground();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5480,13 +5498,13 @@ namespace IDE
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WidgetWindow GetActiveWindow()
|
public WidgetWindow GetActiveWindow(bool allowModal = false)
|
||||||
{
|
{
|
||||||
for (let window in mWindows)
|
for (let window in mWindows)
|
||||||
if (window.mHasFocus)
|
if (window.mHasFocus)
|
||||||
{
|
{
|
||||||
var result = window;
|
var result = window;
|
||||||
while ((result.mWindowFlags.HasFlag(.Modal)) && (result.mParent != null))
|
while ((result.mWindowFlags.HasFlag(.Modal)) && (result.mParent != null) && (!allowModal))
|
||||||
result = result.mParent;
|
result = result.mParent;
|
||||||
return result as WidgetWindow;
|
return result as WidgetWindow;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue