35 explicit Text(std::string text);
41 const std::string &
getText()
const {
return text; }
57 bool getAutoEllipsisTooltip()
const {
return autoEllipsisTooltip_; }
72 bool text_dirty{
true};
74 bool ellipsized_{
false};
75 bool autoEllipsisTooltip_{
true};
76 bool ellipsisHovered_{
false};
77 float cachedFs{-1.0f};
78 float cachedSp{-1.0f};
79 float cachedWrapW{-2.0f};
80 uint32_t cachedFontId{0};
81 FontStack cachedFontStack;
83 std::shared_ptr<const TextLayout> layout_;
84 std::shared_ptr<Tooltip> ellipsisTooltip_;
Centralized standard library includes used throughout ZenitUI.
The node class: tree structure, layout pass, style resolution, input dispatch, render orchestration,...
TLayout(Args &&...args)
Definition Layout.hpp:1401
static std::shared_ptr< Text > create(Args &&...args)
Definition Layout.hpp:1410
bool getWrap() const
Whether word wrapping is enabled.
Definition Text.hpp:50
Vec2 computeIntrinsicSize(float availW, float availH) override
Compute the intrinsic size, excluding padding and border.
const std::string & getText() const
Current content.
Definition Text.hpp:41
void onUpdate(float dt) override
Called every frame from update, after input dispatch.
void setText(std::string new_text)
Replace the content.
void setAutoEllipsisTooltip(bool enabled)
Automatically show a hover tooltip with the full text when ellipsized (default: true).
void onLayout() override
Called after arrange assigns the node's rect.
void setWrap(bool w)
Enable or disable word wrapping.
void renderContent(float op, const ComputedStyle &style) override
Draw the node's content (text, images, custom geometry).
Text(std::string text)
Construct with initial content.
bool isEllipsized() const
True when the text is currently truncated with an ellipsis.
Definition Text.hpp:53
void setFont(FontHandle f)
Override the font used for measurement and rendering.
TextDirection
Inline / layout writing direction for Bidi text and RTL layout mirroring (ยง6.2).
Definition UIEnums.hpp:83
@ Auto
Infer paragraph direction from first strong Bidi character (fallback LTR).
Definition UIEnums.hpp:84
Dense style: every property has a concrete value.
Definition Style.hpp:1036
Opaque handle to a font loaded by TextEngine.
Definition CoreTypes.hpp:135
Typographic parameters governing shaping and measurement.
Definition TextEngine.hpp:51
2D vector with component-wise arithmetic.
Definition CoreTypes.hpp:25