summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-07 15:11:05 +0100
committerGitHub <noreply@github.com>2019-01-07 15:11:05 +0100
commitdb33b03f4910431f859454260e5828a9f306216f (patch)
tree177966a3b66717f80e18fe8cf430431f85dad751 /editor/plugins
parent2e8ca4710ace2a069da25365a0428c656185fb03 (diff)
parent67ac8fe3593c5de3a62d85e3cf0b25228b3637fe (diff)
Merge pull request #24814 from YeldhamDev/animtree_editor_statemach_scrolls
Move scrolls in the StateMachine editor inside the panel
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 431d63aefc..3741e79ef0 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -1308,17 +1308,13 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
play_mode = memnew(OptionButton);
top_hb->add_child(play_mode);
- GridContainer *main_grid = memnew(GridContainer);
- main_grid->set_columns(2);
- add_child(main_grid);
- main_grid->set_v_size_flags(SIZE_EXPAND_FILL);
-
panel = memnew(PanelContainer);
panel->set_clip_contents(true);
- main_grid->add_child(panel);
- panel->set_h_size_flags(SIZE_EXPAND_FILL);
+ add_child(panel);
+ panel->set_v_size_flags(SIZE_EXPAND_FILL);
state_machine_draw = memnew(Control);
+ panel->add_child(state_machine_draw);
state_machine_draw->connect("gui_input", this, "_state_machine_gui_input");
state_machine_draw->connect("draw", this, "_state_machine_draw");
state_machine_draw->set_focus_mode(FOCUS_ALL);
@@ -1329,24 +1325,21 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
state_machine_play_pos->set_anchors_and_margins_preset(PRESET_WIDE);
state_machine_play_pos->connect("draw", this, "_state_machine_pos_draw");
- panel->add_child(state_machine_draw);
- panel->set_v_size_flags(SIZE_EXPAND_FILL);
-
v_scroll = memnew(VScrollBar);
- main_grid->add_child(v_scroll);
+ state_machine_draw->add_child(v_scroll);
+ v_scroll->set_anchors_and_margins_preset(PRESET_RIGHT_WIDE);
v_scroll->connect("value_changed", this, "_scroll_changed");
h_scroll = memnew(HScrollBar);
- main_grid->add_child(h_scroll);
+ state_machine_draw->add_child(h_scroll);
+ h_scroll->set_anchors_and_margins_preset(PRESET_BOTTOM_WIDE);
+ h_scroll->set_margin(MARGIN_RIGHT, -v_scroll->get_size().x * EDSCALE);
h_scroll->connect("value_changed", this, "_scroll_changed");
- main_grid->add_child(memnew(Control)); //empty bottom right
-
error_panel = memnew(PanelContainer);
add_child(error_panel);
error_label = memnew(Label);
error_panel->add_child(error_label);
- error_label->set_text("eh");
undo_redo = EditorNode::get_singleton()->get_undo_redo();