1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Fixed metrics.

This commit is contained in:
Daniel J. Ramirez
2017-09-17 18:58:36 -05:00
parent bc005a57d3
commit 4d14097439
3 changed files with 44 additions and 26 deletions

View File

@@ -4061,27 +4061,29 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
ERR_FAIL_INDEX(p_idx, bottom_panel_items.size());
if (p_enable) {
// this is the debug panel wich uses tabs, so the top section should be smaller
if (ScriptEditor::get_singleton()->get_debugger() == bottom_panel_items[p_idx].control) {
Ref<StyleBoxFlat> style_panel_invisible_top = gui_base->get_stylebox("debugger_panel", "EditorStyles");
bottom_panel->add_style_override("panel", style_panel_invisible_top);
} else {
bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer"));
}
for (int i = 0; i < bottom_panel_items.size(); i++) {
bottom_panel_items[i].button->set_pressed(i == p_idx);
bottom_panel_items[i].control->set_visible(i == p_idx);
}
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<StyleBoxFlat> 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 {
bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer"));
for (int i = 0; i < bottom_panel_items.size(); i++) {
bottom_panel_items[i].button->set_pressed(false);
bottom_panel_items[i].control->set_visible(false);
}
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);
center_split->set_collapsed(true);
}