Increase the project manager's default window size

This makes the project manager feel less cramped when many
projects are imported, or when browsing templates in the asset library.

On displays smaller than 1152x800 (e.g. 1366x768), window height is
automatically limited by DisplayServer when setting the window size.

This also tweaks splash screen size when starting the project manager
to match the project manager's default window size, and allows the
`--resolution` and `--position` CLI arguments to affect the project
manager.

Lastly, this increases the minimum width slightly to prevent the UI
from being cut off with the default theme.
This commit is contained in:
Hugo Locurcio 2024-05-12 23:58:13 +02:00
parent abf8e1e6f9
commit cc86322d8d
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
3 changed files with 20 additions and 4 deletions

View file

@ -2459,6 +2459,15 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->set_current_rendering_driver_name(rendering_driver);
OS::get_singleton()->set_current_rendering_method(rendering_method);
#ifdef TOOLS_ENABLED
if (!force_res && project_manager) {
// Ensure splash screen size matches the project manager window size
// (see `editor/project_manager.cpp` for defaults).
window_size.width = ProjectManager::DEFAULT_WINDOW_WIDTH;
window_size.height = ProjectManager::DEFAULT_WINDOW_HEIGHT;
}
#endif
if (use_custom_res) {
if (!force_res) {
window_size.width = GLOBAL_GET("display/window/size/viewport_width");