0ad/source/gui
trompetin17 19e82ebceb
Add getPreferredTextSize to calculate unconstrained text width
Introduces (CButton|CText).getPreferredTextSize, a new method for estimating
the natural width of a caption if the object had no width constraints.

Unlike .getTextSize, which reports the size after applying current
layout constraints (e.g., fixed width or anchors), getPreferredTextSize
answers the question: "How wide would this object need to be to display
the caption on a single line?"

This is particularly useful for modders and layout logic that wants to
dynamically size elements *before* assigning a fixed width or anchoring.
2025-06-26 16:58:32 -05:00
..
ObjectBases Remove UNUSED 2025-06-26 17:25:05 +02:00
ObjectTypes Add getPreferredTextSize to calculate unconstrained text width 2025-06-26 16:58:32 -05:00
Scripting Add getPreferredTextSize to calculate unconstrained text width 2025-06-26 16:58:32 -05:00
SettingTypes Allow setting CGUISize properties directly 2025-06-17 12:57:33 -05:00
tests Enable modules in the GUI 2025-06-26 10:50:21 +02:00
CGUI.cpp Enable modules in the GUI 2025-06-26 10:50:21 +02:00
CGUI.h Enable modules in the GUI 2025-06-26 10:50:21 +02:00
CGUIScrollBarHorizontal.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CGUIScrollBarHorizontal.h Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CGUIScrollBarVertical.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CGUIScrollBarVertical.h Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CGUISetting.cpp Allow setting CGUISize properties directly 2025-06-17 12:57:33 -05:00
CGUISetting.h Fix no-pch build after b34f4b79aa 2025-06-18 21:12:33 +02:00
CGUISprite.cpp Add font engine aware of Gui.scale 2025-05-26 13:12:47 -05:00
CGUISprite.h Add font engine aware of Gui.scale 2025-05-26 13:12:47 -05:00
CGUIText.cpp Add font engine aware of Gui.scale 2025-05-26 13:12:47 -05:00
CGUIText.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
GUIManager.cpp Enable modules in the GUI 2025-06-26 10:50:21 +02:00
GUIManager.h Enable modules in the GUI 2025-06-26 10:50:21 +02:00
GUIObjectEventBroadcaster.h Add scrollpanel widget 2024-11-12 15:01:42 -05:00
GUIObjectTypes.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
GUIRenderer.cpp Add font engine aware of Gui.scale 2025-05-26 13:12:47 -05:00
GUIRenderer.h Add font engine aware of Gui.scale 2025-05-26 13:12:47 -05:00
GUIStringConversions.cpp Remove UNUSED 2025-06-26 17:25:05 +02:00
GUITooltip.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
GUITooltip.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
IGUIScrollBar.cpp Fix trailing whitespace and add pre-commit hook 2025-06-15 20:08:48 +02:00
IGUIScrollBar.h Remove UNUSED 2025-06-26 17:25:05 +02:00
SGUIIcon.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
SGUIMessage.h Add scrollpanel widget 2024-11-12 15:01:42 -05:00
SGUIStyle.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00