diff --git a/src/dialogxml/dialogs/dialog.cpp b/src/dialogxml/dialogs/dialog.cpp index 917b179b..278886e1 100644 --- a/src/dialogxml/dialogs/dialog.cpp +++ b/src/dialogxml/dialogs/dialog.cpp @@ -445,6 +445,12 @@ void cDialog::recalcRect(){ winRect.right *= get_ui_scale(); winRect.bottom *= get_ui_scale(); + // Uncomment if you need to measure any dialogs. + /* + LOG_VALUE(fname); + LOG_VALUE(winRect.right); + LOG_VALUE(winRect.bottom); + */ } bool cDialog::initCalled = false; diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 7f7555d2..414bb210 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -1079,6 +1079,7 @@ void init_boe(int argc, char* argv[]) { init_tiling(); init_snd_tool(); + // see fallback_scale() in winutil.cpp for where the default UI scale is calculated based on screen size adjust_window_mode(); init_ui(); // If we don't do this now it'll flash white to start with diff --git a/src/tools/winutil.cpp b/src/tools/winutil.cpp index 2cafde6b..56e778d8 100644 --- a/src/tools/winutil.cpp +++ b/src/tools/winutil.cpp @@ -3,8 +3,11 @@ #include #include "keymods.hpp" +// Measured on 5/23/25. For now, must be re-measured at 1x UI scale whenever preferences change (unless making the window smaller, maybe). +short prefs_height = 529; + // The default scale should be the largest that the user's screen can fit all three -// BoE application windows (because they should probably default to match each other). +// BoE application windows and core dialogs of the main game (because they should probably default to match each other). double fallback_scale() { static double scale = 0; // Suppress the float comparison warning. @@ -17,7 +20,7 @@ double fallback_scale() { sf::VideoMode desktop = sf::VideoMode::getDesktopMode(); short max_width = max(boe_width, max(pc_width, scen_width)); - short max_height = max(boe_height, max(pc_height, scen_height)) + getMenubarHeight(); + short max_height = max(prefs_height, max(boe_height, max(pc_height, scen_height))) + getMenubarHeight(); std::vector scale_options = {1.0, 1.5, 2.0, 3.0, 4.0}; for(auto it = scale_options.rbegin(); it != scale_options.rend(); ++it){