diff options
Diffstat (limited to 'scene/gui/rich_text_label.h')
-rw-r--r-- | scene/gui/rich_text_label.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 019edf5d45..67a3f466a6 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -39,7 +39,6 @@ class RichTextLabel : public Control { public: enum Align { - ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, @@ -47,14 +46,12 @@ public: }; enum ListType { - LIST_NUMBERS, LIST_LETTERS, LIST_DOTS }; enum ItemType { - ITEM_FRAME, ITEM_TEXT, ITEM_IMAGE, @@ -149,6 +146,7 @@ private: struct ItemImage : public Item { Ref<Texture2D> image; Size2 size; + Color color; ItemImage() { type = ITEM_IMAGE; } }; @@ -343,7 +341,6 @@ private: }; enum ProcessMode { - PROCESS_CACHE, PROCESS_DRAW, PROCESS_POINTER @@ -381,6 +378,8 @@ private: bool _find_by_type(Item *p_item, ItemType p_type); void _fetch_item_fx_stack(Item *p_item, Vector<ItemFX *> &r_stack); + static Color _get_color_from_string(const String &p_color_str, const Color &p_default_color); + void _update_scroll(); void _update_fx(ItemFrame *p_frame, float p_delta_time); void _scroll_changed(double); @@ -400,13 +399,15 @@ private: int fixed_width; + bool fit_content_height; + protected: void _notification(int p_what); public: String get_text(); void add_text(const String &p_text); - void add_image(const Ref<Texture2D> &p_image, const int p_width = 0, const int p_height = 0); + void add_image(const Ref<Texture2D> &p_image, const int p_width = 0, const int p_height = 0, const Color &p_color = Color(1.0, 1.0, 1.0)); void add_newline(); bool remove_line(const int p_line); void push_font(const Ref<Font> &p_font); @@ -453,20 +454,24 @@ public: void set_tab_size(int p_spaces); int get_tab_size() const; + void set_fit_content_height(bool p_enabled); + bool is_fit_content_height_enabled() const; + bool search(const String &p_string, bool p_from_selection = false, bool p_search_previous = false); void scroll_to_line(int p_line); int get_line_count() const; int get_visible_line_count() const; - int get_content_height(); + int get_content_height() const; VScrollBar *get_v_scroll() { return vscroll; } - virtual CursorShape get_cursor_shape(const Point2 &p_pos) const; + virtual CursorShape get_cursor_shape(const Point2 &p_pos) const override; void set_selection_enabled(bool p_enabled); bool is_selection_enabled() const; + String get_selected_text(); void selection_copy(); Error parse_bbcode(const String &p_bbcode); @@ -493,7 +498,7 @@ public: void install_effect(const Variant effect); void set_fixed_size_to_width(int p_width); - virtual Size2 get_minimum_size() const; + virtual Size2 get_minimum_size() const override; RichTextLabel(); ~RichTextLabel(); |