Commit graph

5 commits

Author SHA1 Message Date
trompetin17
ffdf527d90
Fix label resizing in Map Browser
Refs: #8188
2025-07-17 09:46:18 -05:00
trompetin17
b42a2b9adb
Apply correct use of TextSize APIs in GUI
Updates GUI code to apply the correct usage of `guiObject.getTextSize()`
and `guiObject.GetPreferedTextSize()`.

- `guiObject.getPreferedTextSize()` is now used when the goal is to compute the
  bounding box of a text string to dynamically resize or layout a GUI
  object accordingly. It simulates how the text would be rendered,
  accounting for markup and layout rules.

- `guiObject.getTextSize()` remains in use when text is being measured
  within a fixed-size GUI element (e.g., a button or label). It respects
  internal constraints like buffer zone and maxWidth, and is typically
  used to align other elements based on its visual appearance.

These changes ensure more accurate text sizing and consistent layout
behavior across GUI components.
2025-06-26 17:11:24 -05:00
Vantha
fd847c2a23
Refactor GUI object resizing JS code passages
It is possible to modify sizes by setting the properties directly.
(Without having to create a copy of it)
This allows to shorten those passages quite a bit without any functional change.
2025-06-17 12:57:37 -05:00
Ralph Sennhauser
7e73841d50
Fix eslint rule 'prefer-const' in gui/maps
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
    binaries/data/mods/public/gui/maps

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 17:18:12 +02:00
wraitii
ae9ea5b859 Map browser, used in the gamesetup and in the main menu.
This grid-based system allows browsing all available maps at a glance,
encouraging more diversity and making it nicer to pick a map.

Moves the mapCache and the map filters controller to the gui maps/
folders, and include that folder where it is used, instead of them being
in common/ or the gamesetup.

Comments By: Freagarach
Patch By: Nani (reworked by elexis then wraitii)
Fixes #5315 (though further work, such as proper scrolling, would be
nice).

Differential Revision: https://code.wildfiregames.com/D1703
This was SVN commit r24459.
2020-12-27 15:26:19 +00:00