diff options
Diffstat (limited to 'scene/gui/scroll_container.cpp')
-rw-r--r-- | scene/gui/scroll_container.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 85dd73beeb..b4e28a1f1b 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -33,6 +33,7 @@ #include "core/config/project_settings.h" #include "core/os/os.h" #include "scene/main/window.h" +#include "scene/theme/theme_db.h" Size2 ScrollContainer::get_minimum_size() const { Size2 min_size; @@ -80,12 +81,6 @@ Size2 ScrollContainer::get_minimum_size() const { return min_size; } -void ScrollContainer::_update_theme_item_cache() { - Container::_update_theme_item_cache(); - - theme_cache.panel_style = get_theme_stylebox(SNAME("panel")); -} - void ScrollContainer::_cancel_drag() { set_physics_process_internal(false); drag_touching_deaccel = false; @@ -356,7 +351,7 @@ void ScrollContainer::_notification(int p_what) { case NOTIFICATION_READY: { Viewport *viewport = get_viewport(); - ERR_FAIL_COND(!viewport); + ERR_FAIL_NULL(viewport); viewport->connect("gui_focus_changed", callable_mp(this, &ScrollContainer::_gui_focus_changed)); _reposition_children(); } break; @@ -627,6 +622,8 @@ void ScrollContainer::_bind_methods() { BIND_ENUM_CONSTANT(SCROLL_MODE_SHOW_ALWAYS); BIND_ENUM_CONSTANT(SCROLL_MODE_SHOW_NEVER); + BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_STYLEBOX, ScrollContainer, panel_style, "panel"); + GLOBAL_DEF("gui/common/default_scroll_deadzone", 0); }; |