Make the preferences window big enough for HDPI fonts

The hardcoded size of the window was too small for the large fonts on HDPI
displays, this changes to using the automatic width and calculated-based-on-dpi
height. On HDPI displays that does leave blank space on the General tab, but it's
better than not scaling.

Buttons that were placed at the bottom of pages move up so that they aren't
too far from the other controls. The sub-tab-selector buttons on the
multiplayer tab move above the sub-tabs themselves.

With HDPI text, the checkboxes are placed a little too high to align with
the font, but that's a cosmetic detail; this commit fixes the usability issue.
This commit is contained in:
Steve Cotton 2021-02-10 12:24:56 +01:00 committed by Steve Cotton
parent 56bdd42815
commit 09c8c506e1
5 changed files with 38 additions and 18 deletions

View file

@ -25,6 +25,7 @@
* Added a "disengaged" orb, shown instead of the partially-moved orb for units that can move but can't attack.
* Added information about the build's (not runtime) target CPU architecture to the game version info dialog and --report.
* Added terminal-style command history browsing with up-down keys for in-game consoles used by debug mode, ai and search floating textboxes.
* Made the preferences dialog larger on HDPI screens; this fixes a usability issue with HDPI font sizes (issue #5185).
### WML Engine
* Extent 'special_id_active' and 'special_type_active' to abilities used like weapon and to [leadership] abilities.
* abilities used like weapon can call [leading_anim] now.

View file

@ -129,7 +129,8 @@
[resolution]
definition = "default"
{GUI_WINDOW_FIXED_SIZE_CENTERED 800 600}
# The hotkey list will always want to be as tall as possible, which causes a lot of blank space on the other tabs. Limit the height so that the "General" tab fits the content tightly with non-HDPI fonts, and looks reasonable with HDPI fonts.
maximum_height = "({GUI_SCALE_RESOLUTION 600})"
[linked_group]
id = "page_icon"

View file

@ -225,6 +225,8 @@
[layer]
[row]
grow_factor = 0
[column]
horizontal_grow = true
vertical_alignment = "top"
@ -234,10 +236,14 @@
[/column]
[/row]
{_GUI_PREFERENCES_SPACER_ROW}
[row]
grow_factor = 1
[column]
horizontal_alignment = "left"
vertical_alignment = "bottom"
vertical_alignment = "top"
[grid]
{_GUI_PREFERENCES_GENERAL_GRID_2}

View file

@ -297,6 +297,8 @@
[layer]
[row]
grow_factor = 0
[column]
horizontal_grow = true
vertical_alignment = "top"
@ -307,10 +309,14 @@
[/column]
[/row]
{_GUI_PREFERENCES_SPACER_ROW}
[row]
grow_factor = 1
[column]
horizontal_alignment = "left"
vertical_alignment = "bottom"
vertical_alignment = "top"
[grid]
{_GUI_PREFERENCES_DISPLAY_GRID_2}

View file

@ -142,7 +142,7 @@
border = "all"
border_size = 5
horizontal_alignment = "left"
vertical_alignment = "bottom"
vertical_alignment = "top"
[button]
id = mp_alerts
@ -155,7 +155,7 @@
border = "all"
border_size = 5
horizontal_alignment = "left"
vertical_alignment = "bottom"
vertical_alignment = "top"
[button]
id = mp_wesnothd
@ -424,15 +424,29 @@
#enddef
[layer]
[row]
[column]
horizontal_alignment = "left"
vertical_alignment = "top"
[grid]
{_GUI_PREFERENCES_MP_SWITCH_ROW}
[/grid]
[/column]
[/row]
{_GUI_PREFERENCES_SPACER_ROW}
[row]
grow_factor = 1
[column]
horizontal_grow = true
vertical_grow = true
vertical_alignment = "top"
{_GUI_PREFS_TAB_PAGER (
[layer]
[row]
grow_factor = 0
[column]
horizontal_grow = true
vertical_alignment = "top"
@ -443,10 +457,13 @@
[/column]
[/row]
{_GUI_PREFERENCES_SPACER_ROW}
[row]
grow_factor = 1
[column]
horizontal_alignment = "left"
vertical_alignment = "bottom"
vertical_alignment = "top"
[grid]
{_GUI_PREFERENCES_MP_PAGE_1_GRID_2}
@ -471,17 +488,6 @@
[/column]
[/row]
[row]
[column]
horizontal_alignment = "left"
vertical_alignment = "bottom"
[grid]
{_GUI_PREFERENCES_MP_SWITCH_ROW}
[/grid]
[/column]
[/row]
[/layer]
#undef _GUI_PREFERENCES_MP_PAGE_1_GRID_1