Implement Tree's internal minimum width calculation

This commit is contained in:
Gilles Roudière 2021-06-28 15:40:56 +02:00
parent b2dddc3c82
commit d7d32ced5b
20 changed files with 193 additions and 108 deletions

View file

@ -315,16 +315,18 @@ public:
void set_disable_folding(bool p_disable);
bool is_folding_disabled() const;
Size2 get_minimum_size(int p_column);
/* Item manipulation */
TreeItem *create_child(int p_idx = -1);
Tree *get_tree();
Tree *get_tree() const;
TreeItem *get_prev();
TreeItem *get_next();
TreeItem *get_parent();
TreeItem *get_first_child();
TreeItem *get_next() const;
TreeItem *get_parent() const;
TreeItem *get_first_child() const;
TreeItem *get_prev_visible(bool p_wrap = false);
TreeItem *get_next_visible(bool p_wrap = false);
@ -408,7 +410,7 @@ private:
int drop_mode_flags = 0;
struct ColumnInfo {
int min_width = 1;
int custom_min_width = 0;
bool expand = true;
String title;
Ref<TextLine> text_buf;
@ -625,11 +627,12 @@ public:
void clear();
TreeItem *create_item(TreeItem *p_parent = nullptr, int p_idx = -1);
TreeItem *get_root();
TreeItem *get_last_item();
TreeItem *get_root() const;
TreeItem *get_last_item() const;
void set_column_min_width(int p_column, int p_min_width);
void set_column_custom_minimum_width(int p_column, int p_min_width);
void set_column_expand(int p_column, bool p_expand);
int get_column_minimum_width(int p_column) const;
int get_column_width(int p_column) const;
void set_hide_root(bool p_enabled);