mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +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);
|
||||
if (setFocus)
|
||||
panel.FocusForKeyboard();
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -5480,13 +5498,13 @@ namespace IDE
|
|||
return null;
|
||||
}
|
||||
|
||||
public WidgetWindow GetActiveWindow()
|
||||
public WidgetWindow GetActiveWindow(bool allowModal = false)
|
||||
{
|
||||
for (let window in mWindows)
|
||||
if (window.mHasFocus)
|
||||
{
|
||||
var result = window;
|
||||
while ((result.mWindowFlags.HasFlag(.Modal)) && (result.mParent != null))
|
||||
while ((result.mWindowFlags.HasFlag(.Modal)) && (result.mParent != null) && (!allowModal))
|
||||
result = result.mParent;
|
||||
return result as WidgetWindow;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue