You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Keep focus on floating window when showing ProgressDialog
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user