0ad/source/gui/Scripting
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
..
GuiScriptConversions.cpp Remove the name of some unused arguments 2025-06-18 12:49:59 +02:00
JSInterface_CGUISize.cpp Allow setting CGUISize properties directly 2025-06-17 12:57:33 -05:00
JSInterface_CGUISize.h Allow setting CGUISize properties directly 2025-06-17 12:57:33 -05:00
JSInterface_GUIManager.cpp Rename PushGuiPage to OpenChildPage 2025-03-09 10:39:20 +01:00
JSInterface_GUIManager.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
JSInterface_GUIProxy.cpp Add getPreferredTextSize to calculate unconstrained text width 2025-06-26 16:58:32 -05:00
JSInterface_GUIProxy.h Remove UNUSED 2025-06-26 17:25:05 +02:00
JSInterface_GUIProxy_impl.h Remove UNUSED 2025-06-26 17:25:05 +02:00
JSInterface_GUISize.cpp Adapt 0 A.D. to SpiderMonkey ESR 102 2024-12-09 10:43:35 +01:00
JSInterface_GUISize.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
ScriptFunctions.cpp Allow setting CGUISize properties directly 2025-06-17 12:57:33 -05:00
ScriptFunctions.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00