0ad/source/gui/ObjectTypes
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
..
CButton.cpp Add getPreferredTextSize to calculate unconstrained text width 2025-06-26 16:58:32 -05:00
CButton.h Add getPreferredTextSize to calculate unconstrained text width 2025-06-26 16:58:32 -05:00
CChart.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CChart.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CCheckBox.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CCheckBox.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CDropDown.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CDropDown.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CGUIDummyObject.h Remove the name of some unused arguments 2025-06-18 12:49:59 +02:00
CHotkeyPicker.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CHotkeyPicker.h Remove the name of some unused arguments 2025-06-18 12:49:59 +02:00
CImage.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CImage.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CInput.cpp Align font height, capHeight to FreeType metrics 2025-06-11 08:10:18 -05:00
CInput.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CList.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CList.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CMiniMap.cpp Remove UNUSED 2025-06-26 17:25:05 +02:00
CMiniMap.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
COList.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
COList.h Finish implementing property "textcolor_selected" for list GUI objects 2024-07-03 08:32:52 +00:00
CProgressBar.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CProgressBar.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CRadioButton.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CRadioButton.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CScrollPanel.cpp Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CScrollPanel.h Add scrollpanel widget 2024-11-12 15:01:42 -05:00
CSlider.cpp Remove FALLTHROUGH on empty cases 2025-01-29 19:34:12 +01:00
CSlider.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
CText.cpp Add getPreferredTextSize to calculate unconstrained text width 2025-06-26 16:58:32 -05:00
CText.h Add getPreferredTextSize to calculate unconstrained text width 2025-06-26 16:58:32 -05:00
CTooltip.cpp Tooltip set like ghost 2024-10-27 17:18:42 -05:00
CTooltip.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00