Merge pull request #67215 from Nidjo123/project-dialog-resize

Resize project dialog only when necessary
This commit is contained in:
Rémi Verschelde 2022-10-11 23:26:37 +02:00 committed by GitHub
commit 3229194dfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -143,7 +143,11 @@ private:
install_status_rect->set_texture(new_icon);
}
set_size(Size2(500, 0) * EDSCALE);
Size2i window_size = get_size();
Size2 contents_min_size = get_contents_minimum_size();
if (window_size.x < contents_min_size.x || window_size.y < contents_min_size.y) {
set_size(window_size.max(contents_min_size));
}
}
String _test_path() {

View file

@ -651,9 +651,9 @@ void Window::_update_window_size() {
DisplayServer::get_singleton()->window_set_min_size(Size2i(), window_id);
}
DisplayServer::get_singleton()->window_set_size(size, window_id);
DisplayServer::get_singleton()->window_set_max_size(max_size_valid ? max_size : Size2i(), window_id);
DisplayServer::get_singleton()->window_set_min_size(size_limit, window_id);
DisplayServer::get_singleton()->window_set_size(size, window_id);
}
//update the viewport