diff options
author | Juan Linietsky <reduzio@gmail.com> | 2020-03-20 17:51:53 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-03-26 15:49:45 +0100 |
commit | 047e0b7de5ca981d955739074919646fade828fb (patch) | |
tree | 6fe439ae04e6edc90aecc6ebb072310234c6178c /scene/gui | |
parent | b3080bc2f4d7bc5c15b3a0ff7b67690c4677577e (diff) |
Reworked tooltips to use the popup system.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/panel_container.cpp | 2 | ||||
-rw-r--r-- | scene/gui/popup.cpp | 8 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 8 |
3 files changed, 13 insertions, 5 deletions
diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp index dc9daf3c91..62b9296409 100644 --- a/scene/gui/panel_container.cpp +++ b/scene/gui/panel_container.cpp @@ -43,7 +43,7 @@ Size2 PanelContainer::get_minimum_size() const { for (int i = 0; i < get_child_count(); i++) { Control *c = Object::cast_to<Control>(get_child(i)); - if (!c || !c->is_visible_in_tree()) + if (!c || !c->is_visible()) continue; if (c->is_set_as_toplevel()) continue; diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 77843262e1..6edafc65a0 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -150,7 +150,7 @@ Popup::~Popup() { Size2 PopupPanel::_get_contents_minimum_size() const { - Ref<StyleBox> p = get_theme_stylebox("panel", "PopupPanel"); + Ref<StyleBox> p = get_theme_stylebox("panel", get_class_name()); Size2 ms; @@ -172,7 +172,7 @@ Size2 PopupPanel::_get_contents_minimum_size() const { void PopupPanel::_update_child_rects() { - Ref<StyleBox> p = get_theme_stylebox("panel", "PopupPanel"); + Ref<StyleBox> p = get_theme_stylebox("panel", get_class_name()); Vector2 cpos(p->get_offset()); Vector2 csize(get_size() - p->get_minimum_size()); @@ -198,10 +198,10 @@ void PopupPanel::_update_child_rects() { void PopupPanel::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED) { - panel->add_theme_style_override("panel", get_theme_stylebox("panel", "PopupPanel")); + panel->add_theme_style_override("panel", get_theme_stylebox("panel", get_class_name())); } else if (p_what == NOTIFICATION_READY || p_what == NOTIFICATION_ENTER_TREE) { - panel->add_theme_style_override("panel", get_theme_stylebox("panel", "PopupPanel")); + panel->add_theme_style_override("panel", get_theme_stylebox("panel", get_class_name())); _update_child_rects(); } else if (p_what == NOTIFICATION_WM_SIZE_CHANGED) { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 614d109534..df28a4c12f 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1647,6 +1647,10 @@ void RichTextLabel::_add_item(Item *p_item, bool p_enter, bool p_ensure_newline) p_item->line = current_frame->lines.size() - 1; _invalidate_current_line(current_frame); + + if (fixed_width != -1) { + minimum_size_changed(); + } } void RichTextLabel::_remove_item(Item *p_item, const int p_line, const int p_subitem_line) { @@ -1968,6 +1972,10 @@ void RichTextLabel::clear() { selection.click = NULL; selection.active = false; current_idx = 1; + + if (fixed_width != -1) { + minimum_size_changed(); + } } void RichTextLabel::set_tab_size(int p_spaces) { |