diff options
author | Yuri Sizov <yuris@humnom.net> | 2021-12-02 17:57:53 +0300 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2021-12-02 17:57:53 +0300 |
commit | c33f407d27a44ae5705fd2d907403af05682d0eb (patch) | |
tree | 48492791120fe424b75412f77219c697e0fb4948 /editor/plugins/theme_editor_preview.cpp | |
parent | 702ffc6243bb1073a454fc713a5a3c2b44b59c93 (diff) |
Allow scrolling theme preview when the control picker is active
Diffstat (limited to 'editor/plugins/theme_editor_preview.cpp')
-rw-r--r-- | editor/plugins/theme_editor_preview.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index f13fcb005f..86b0fc0eaf 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -157,6 +157,7 @@ void ThemeEditorPreview::_gui_input_picker_overlay(const Ref<InputEvent> &p_even emit_signal(SNAME("control_picked"), theme_type); picker_button->set_pressed(false); picker_overlay->set_visible(false); + return; } } @@ -167,6 +168,9 @@ void ThemeEditorPreview::_gui_input_picker_overlay(const Ref<InputEvent> &p_even hovered_control = _find_hovered_control(preview_content, mp); picker_overlay->update(); } + + // Forward input to the scroll container underneath to allow scrolling. + preview_container->gui_input(p_event); } void ThemeEditorPreview::_reset_picker_overlay() { @@ -223,7 +227,7 @@ ThemeEditorPreview::ThemeEditorPreview() { preview_body->set_v_size_flags(SIZE_EXPAND_FILL); add_child(preview_body); - ScrollContainer *preview_container = memnew(ScrollContainer); + preview_container = memnew(ScrollContainer); preview_container->set_enable_v_scroll(true); preview_container->set_enable_h_scroll(true); preview_body->add_child(preview_container); |