Merge pull request #7634 from RandomShaper/fs-split-layout-2.1

Include filesystem dock split offset in editor layouts (2.1)
This commit is contained in:
Rémi Verschelde 2017-01-25 07:37:45 +01:00 committed by GitHub
commit e4efab04bb
2 changed files with 11 additions and 0 deletions

View file

@ -4492,6 +4492,8 @@ void EditorNode::_save_docks_to_config(Ref<ConfigFile> p_layout, const String& p
} }
} }
p_layout->set_value(p_section,"dock_filesystem_split",filesystem_dock->get_split_offset());
VSplitContainer*splits[DOCK_SLOT_MAX/2]={ VSplitContainer*splits[DOCK_SLOT_MAX/2]={
left_l_vsplit, left_l_vsplit,
left_r_vsplit, left_r_vsplit,
@ -4665,6 +4667,12 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String&
} }
} }
int fs_split_ofs = 0;
if (p_layout->has_section_key(p_section,"dock_filesystem_split")) {
fs_split_ofs = p_layout->get_value(p_section,"dock_filesystem_split");
}
filesystem_dock->set_split_offset(fs_split_ofs);
VSplitContainer*splits[DOCK_SLOT_MAX/2]={ VSplitContainer*splits[DOCK_SLOT_MAX/2]={
left_l_vsplit, left_l_vsplit,
left_r_vsplit, left_r_vsplit,

View file

@ -191,6 +191,9 @@ public:
void set_display_mode(int p_mode); void set_display_mode(int p_mode);
int get_split_offset() { return split_box->get_split_offset(); }
void set_split_offset(int p_offset) { split_box->set_split_offset(p_offset); }
FileSystemDock(EditorNode *p_editor); FileSystemDock(EditorNode *p_editor);
~FileSystemDock(); ~FileSystemDock();
}; };