diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2021-07-13 13:10:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-13 13:10:42 +0200 |
| commit | aab6dc301cc2da010ad44da5c08ba3686ef9238a (patch) | |
| tree | 269b0c913e3e5145f5ed9c449df8a22992adbef2 /scene/gui/label.h | |
| parent | dd274139073da7119dfe8801c8dd29275c5fd830 (diff) | |
| parent | 56a8d3f30c09fdc03b19ef48a97d344ffe2df974 (diff) | |
| download | redot-engine-aab6dc301cc2da010ad44da5c08ba3686ef9238a.tar.gz | |
Merge pull request #50086 from Geometror/label-improve-layout-options
Improvements to Label's layout options
Diffstat (limited to 'scene/gui/label.h')
| -rw-r--r-- | scene/gui/label.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/scene/gui/label.h b/scene/gui/label.h index 032b4112e1..8b48eb9670 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -51,13 +51,29 @@ public: VALIGN_FILL }; + enum AutowrapMode { + AUTOWRAP_OFF, + AUTOWRAP_ARBITRARY, + AUTOWRAP_WORD, + AUTOWRAP_WORD_SMART + }; + + enum OverrunBehavior { + OVERRUN_NO_TRIMMING, + OVERRUN_TRIM_CHAR, + OVERRUN_TRIM_WORD, + OVERRUN_TRIM_ELLIPSIS, + OVERRUN_TRIM_WORD_ELLIPSIS, + }; + private: Align align = ALIGN_LEFT; VAlign valign = VALIGN_TOP; String text; String xl_text; - bool autowrap = false; + AutowrapMode autowrap_mode = AUTOWRAP_OFF; bool clip = false; + OverrunBehavior overrun_behavior = OVERRUN_NO_TRIMMING; Size2 minsize; bool uppercase = false; @@ -118,8 +134,8 @@ public: void set_structured_text_bidi_override_options(Array p_args); Array get_structured_text_bidi_override_options() const; - void set_autowrap(bool p_autowrap); - bool has_autowrap() const; + void set_autowrap_mode(AutowrapMode p_mode); + AutowrapMode get_autowrap_mode() const; void set_uppercase(bool p_uppercase); bool is_uppercase() const; @@ -131,6 +147,9 @@ public: void set_clip_text(bool p_clip); bool is_clipping_text() const; + void set_text_overrun_behavior(OverrunBehavior p_behavior); + OverrunBehavior get_text_overrun_behavior() const; + void set_percent_visible(float p_percent); float get_percent_visible() const; @@ -150,5 +169,7 @@ public: VARIANT_ENUM_CAST(Label::Align); VARIANT_ENUM_CAST(Label::VAlign); +VARIANT_ENUM_CAST(Label::AutowrapMode); +VARIANT_ENUM_CAST(Label::OverrunBehavior); #endif |
