From 4ccf3bb2ed9811d406c5d3dbb2be692751e2eb9e Mon Sep 17 00:00:00 2001 From: toger5 Date: Wed, 13 Sep 2017 02:36:26 +0200 Subject: [PATCH 1/2] made tabs visible in debugger fixes: #11212 - the stylebox is changed so the top part is transparent when the debugger is selected --- editor/editor_node.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 76b108f77927..950f5dcc6c52 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4033,6 +4033,15 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { bottom_panel_items[i].button->set_pressed(i == p_idx); bottom_panel_items[i].control->set_visible(i == p_idx); } + // ScriptEditor::get_singleton()->get_debugger() == bottom_panel_items[i].control + if (ScriptEditor::get_singleton()->get_debugger() == bottom_panel_items[p_idx].control) { // this is the debug panel wich uses tabs, so the top section should be smaller + Ref style_panel_invisible_top = gui_base->get_stylebox("panel", "TabContainer")->duplicate(); + int stylebox_offset = gui_base->get_font("font", "Tabs")->get_height() + gui_base->get_stylebox("tab_fg", "Tabs")->get_minimum_size().height + gui_base->get_stylebox("panel", "TabContainer")->get_default_margin(MARGIN_TOP); + style_panel_invisible_top->set_expand_margin_size(MARGIN_TOP, -stylebox_offset); + bottom_panel->add_style_override("panel", style_panel_invisible_top); + } else { + bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); + } center_split->set_dragger_visibility(SplitContainer::DRAGGER_VISIBLE); center_split->set_collapsed(false); } else { From b37e869c89208a7b7f04b95bbba36ea57d7fb8fc Mon Sep 17 00:00:00 2001 From: toger5 Date: Fri, 15 Sep 2017 00:28:54 +0200 Subject: [PATCH 2/2] fixed double border for debugger tab panel --- editor/editor_node.cpp | 1 - editor/script_editor_debugger.cpp | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 950f5dcc6c52..b1dcee14689c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4033,7 +4033,6 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) { bottom_panel_items[i].button->set_pressed(i == p_idx); bottom_panel_items[i].control->set_visible(i == p_idx); } - // ScriptEditor::get_singleton()->get_debugger() == bottom_panel_items[i].control if (ScriptEditor::get_singleton()->get_debugger() == bottom_panel_items[p_idx].control) { // this is the debug panel wich uses tabs, so the top section should be smaller Ref style_panel_invisible_top = gui_base->get_stylebox("panel", "TabContainer")->duplicate(); int stylebox_offset = gui_base->get_font("font", "Tabs")->get_height() + gui_base->get_stylebox("tab_fg", "Tabs")->get_minimum_size().height + gui_base->get_stylebox("panel", "TabContainer")->get_default_margin(MARGIN_TOP); diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 284b25801cf9..9a6449727c56 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1622,8 +1622,9 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); - tabs->set_v_size_flags(SIZE_EXPAND_FILL); tabs->set_area_as_parent_rect(); + tabs->set_margin(MARGIN_LEFT, -EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel", "TabContainer")->get_margin(MARGIN_LEFT)); + tabs->set_margin(MARGIN_RIGHT, EditorNode::get_singleton()->get_gui_base()->get_stylebox("panel", "TabContainer")->get_margin(MARGIN_LEFT)); add_child(tabs); { //debugger