Engine.GetTextWidth has been deprecated since e845da025a
Idea:
If you look at a dropdown as just a text field (its header) that can
change caption like any other, then getPreferredHeaderTextSize is the
equivalent to getPreferredTextSize (present on buttons and text fields).
Fixes#8493
(cherry picked from commit 670f1e5d42)
Signed-off-by: phosit <phosit@autistici.org>
Make include-what-you-use happy with most of the files in source/gui and
fix what needs to be fixed after including missing compile flags.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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.
This PR introduces a new ScrollPanel component with the following
capabilities:
- Scroll Orientation Support: Allows scrolling in horizontal, vertical,
or both directions, providing flexibility for different use cases.
- Partial Object Rendering: Supports partial rendering of objects that
are only partially visible within the scroll boundaries, improving
visual accuracy and performance.
- Boundary-Constrained Mouse Interaction: Handles mouse events strictly
within the panel's visible boundaries, preventing interaction with
objects outside the scrollable area.
- Minimum Internal Size (min_width, min_height): Introduces support for
virtual space management, allowing the panel to maintain a minimum
internal size independent of its actual on-screen dimensions. Even
when the panel is resized, this ensures that the content respects a
defined virtual space (with min_width and min_height), effectively
simulating a larger internal canvas. This is particularly useful for
large content or scenarios where a more extensive scrollable area is
required than the current visible panel.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful
Will add linter rule in seperate commit
Happy recompiling everyone!
Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
Add flaring on the map and resize the minimap buttons.
Target marker and button by Stan.
Reviewed/Commented by wraitii, elexis, vladislavbelov
Refs: #3491
Refs: #57
Differential Revision: https://code.wildfiregames.com/D1751
This was SVN commit r25691.
This finishes 7c04ea0211 and 1b67a079fb.
GUI Proxy objects are now easier to specialize, code duplication is
reduced, code is made safer.
In details:
- the proxy private is always the IGUIObject* pointer
- the private data is accessed through a safer wrapper
- CreateJSObject returns an opaque type to allow easier extension &
prevent errors.
- The implementation of CreateJSObject is moved near the GUI Proxy
template instantiation, and both are wrapped in a convenient macro (this
makes it so that if you use the macro, you can't forget to overload the
method, and vice-versa).
- The common IGUIObject JS interface no longer needs to be repeated.
- All specialisations are again put in the same file, for improved
compile-time & clarity, given there are so few lines now.
- While at it, implement toSource which makes it possible to `uneval`
components (does the same as toString though).
Differential Revision: https://code.wildfiregames.com/D3826
This was SVN commit r25225.