diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-16 09:14:40 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-16 09:14:40 +0200 |
commit | da80a033f118b44334a2c0b6d75e1df39236191e (patch) | |
tree | 63e4e3e74aa99ea0ba0c8003acfb434ce88ca1ab | |
parent | 4ed3f67229d2c8b8dbdc9306e41e22dda7b33889 (diff) | |
parent | 3709ca5404facdfd06fb6892d56f206471a468db (diff) | |
download | redot-engine-da80a033f118b44334a2c0b6d75e1df39236191e.tar.gz |
Merge pull request #80606 from bruvzg/rtl_scroll_hide
[RTL] Improve scroll bar responsiveness during updates.
-rw-r--r-- | scene/gui/rich_text_label.cpp | 13 | ||||
-rw-r--r-- | scene/gui/scroll_bar.cpp | 8 |
2 files changed, 20 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 3a0fb6d89c..1e7e376fc8 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2745,6 +2745,9 @@ void RichTextLabel::_thread_function(void *p_userdata) { void RichTextLabel::_thread_end() { set_physics_process_internal(false); + if (!scroll_visible) { + vscroll->hide(); + } if (is_visible_in_tree()) { queue_redraw(); } @@ -2814,7 +2817,6 @@ _FORCE_INLINE_ float RichTextLabel::_update_scroll_exceeds(float p_total_height, } else { scroll_visible = false; scroll_w = 0; - vscroll->hide(); } main->first_resized_line.store(0); @@ -2862,6 +2864,9 @@ bool RichTextLabel::_validate_line_caches() { if (main->first_resized_line.load() == (int)main->lines.size()) { vscroll->set_value(old_scroll); validating.store(false); + if (!scroll_visible) { + vscroll->hide(); + } return true; } @@ -2881,6 +2886,9 @@ bool RichTextLabel::_validate_line_caches() { update_minimum_size(); } validating.store(false); + if (!scroll_visible) { + vscroll->hide(); + } return true; } validating.store(false); @@ -2896,6 +2904,9 @@ bool RichTextLabel::_validate_line_caches() { updating.store(true); _process_line_caches(); updating.store(false); + if (!scroll_visible) { + vscroll->hide(); + } queue_redraw(); return true; } diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index fcf9302953..06b3882d25 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -428,6 +428,14 @@ void ScrollBar::_notification(int p_what) { } } break; + case NOTIFICATION_VISIBILITY_CHANGED: { + if (!is_visible()) { + incr_active = false; + decr_active = false; + drag.active = false; + } + } break; + case NOTIFICATION_MOUSE_EXIT: { highlight = HIGHLIGHT_NONE; queue_redraw(); |