summaryrefslogtreecommitdiff
path: root/scene/gui/item_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/item_list.h')
-rw-r--r--scene/gui/item_list.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index 148fa7ba9f..e780179e7b 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -54,7 +54,7 @@ private:
Ref<Texture2D> icon;
bool icon_transposed = false;
Rect2i icon_region;
- Color icon_modulate;
+ Color icon_modulate = Color(1, 1, 1, 1);
Ref<Texture2D> tag_icon;
String text;
Ref<TextParagraph> text_buf;
@@ -65,11 +65,11 @@ private:
bool selectable = false;
bool selected = false;
bool disabled = false;
- bool tooltip_enabled = false;
+ bool tooltip_enabled = true;
Variant metadata;
String tooltip;
Color custom_fg;
- Color custom_bg;
+ Color custom_bg = Color(0.0, 0.0, 0.0, 0.0);
Rect2 rect_cache;
Rect2 min_rect_cache;
@@ -77,6 +77,10 @@ private:
Size2 get_icon_size() const;
bool operator<(const Item &p_another) const { return text < p_another.text; }
+
+ Item() {
+ text_buf.instantiate();
+ }
};
int current = -1;
@@ -119,14 +123,14 @@ private:
bool do_autoscroll_to_bottom = false;
- Array _get_items() const;
- void _set_items(const Array &p_items);
-
void _scroll_changed(double);
void _shape(int p_idx);
protected:
void _notification(int p_what);
+ bool _set(const StringName &p_name, const Variant &p_value);
+ bool _get(const StringName &p_name, Variant &r_ret) const;
+ void _get_property_list(List<PropertyInfo> *p_list) const;
static void _bind_methods();
public:
@@ -199,6 +203,7 @@ public:
void move_item(int p_from_idx, int p_to_idx);
+ void set_item_count(int p_count);
int get_item_count() const;
void remove_item(int p_idx);