mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Keep focus on floating window when showing ProgressDialog
This commit is contained in:
parent
6916349697
commit
9ae48c72b4
3 changed files with 19 additions and 0 deletions
|
@ -147,6 +147,13 @@ void ProgressDialog::_popup() {
|
|||
main->set_offset(SIDE_BOTTOM, -style->get_margin(SIDE_BOTTOM));
|
||||
|
||||
if (!is_inside_tree()) {
|
||||
for (Window *window : host_windows) {
|
||||
if (window->has_focus()) {
|
||||
popup_exclusive_centered(window, ms);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// No host window found, use main window.
|
||||
EditorInterface::get_singleton()->popup_dialog_centered(this, ms);
|
||||
}
|
||||
}
|
||||
|
@ -226,6 +233,11 @@ void ProgressDialog::end_task(const String &p_task) {
|
|||
}
|
||||
}
|
||||
|
||||
void ProgressDialog::add_host_window(Window *p_window) {
|
||||
ERR_FAIL_NULL(p_window);
|
||||
host_windows.push_back(p_window);
|
||||
}
|
||||
|
||||
void ProgressDialog::_cancel_pressed() {
|
||||
canceled = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue