Merge pull request #55548 from pycbouh/editor-scroll-dat-preview
This commit is contained in:
commit
11d5b91462
3 changed files with 8 additions and 2 deletions
|
@ -157,6 +157,7 @@ void ThemeEditorPreview::_gui_input_picker_overlay(const Ref<InputEvent> &p_even
|
||||||
emit_signal(SNAME("control_picked"), theme_type);
|
emit_signal(SNAME("control_picked"), theme_type);
|
||||||
picker_button->set_pressed(false);
|
picker_button->set_pressed(false);
|
||||||
picker_overlay->set_visible(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);
|
hovered_control = _find_hovered_control(preview_content, mp);
|
||||||
picker_overlay->update();
|
picker_overlay->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Forward input to the scroll container underneath to allow scrolling.
|
||||||
|
preview_container->gui_input(p_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemeEditorPreview::_reset_picker_overlay() {
|
void ThemeEditorPreview::_reset_picker_overlay() {
|
||||||
|
@ -223,7 +227,7 @@ ThemeEditorPreview::ThemeEditorPreview() {
|
||||||
preview_body->set_v_size_flags(SIZE_EXPAND_FILL);
|
preview_body->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||||
add_child(preview_body);
|
add_child(preview_body);
|
||||||
|
|
||||||
ScrollContainer *preview_container = memnew(ScrollContainer);
|
preview_container = memnew(ScrollContainer);
|
||||||
preview_container->set_enable_v_scroll(true);
|
preview_container->set_enable_v_scroll(true);
|
||||||
preview_container->set_enable_h_scroll(true);
|
preview_container->set_enable_h_scroll(true);
|
||||||
preview_body->add_child(preview_container);
|
preview_body->add_child(preview_container);
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
class ThemeEditorPreview : public VBoxContainer {
|
class ThemeEditorPreview : public VBoxContainer {
|
||||||
GDCLASS(ThemeEditorPreview, VBoxContainer);
|
GDCLASS(ThemeEditorPreview, VBoxContainer);
|
||||||
|
|
||||||
|
ScrollContainer *preview_container;
|
||||||
ColorRect *preview_bg;
|
ColorRect *preview_bg;
|
||||||
MarginContainer *preview_overlay;
|
MarginContainer *preview_overlay;
|
||||||
Control *picker_overlay;
|
Control *picker_overlay;
|
||||||
|
|
|
@ -68,7 +68,6 @@ class ScrollContainer : public Container {
|
||||||
protected:
|
protected:
|
||||||
Size2 get_minimum_size() const override;
|
Size2 get_minimum_size() const override;
|
||||||
|
|
||||||
virtual void gui_input(const Ref<InputEvent> &p_gui_input) override;
|
|
||||||
void _gui_focus_changed(Control *p_control);
|
void _gui_focus_changed(Control *p_control);
|
||||||
void _update_dimensions();
|
void _update_dimensions();
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
|
@ -80,6 +79,8 @@ protected:
|
||||||
void _update_scrollbar_position();
|
void _update_scrollbar_position();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual void gui_input(const Ref<InputEvent> &p_gui_input) override;
|
||||||
|
|
||||||
void set_h_scroll(int p_pos);
|
void set_h_scroll(int p_pos);
|
||||||
int get_h_scroll() const;
|
int get_h_scroll() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue