mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-25 18:39:18 +01:00
Prevent docks to be reset to first tab when switching dock visibility
This commit is contained in:
parent
a0d9a05a51
commit
52fdae0600
@ -4491,7 +4491,7 @@ void EditorNode::_load_docks() {
|
|||||||
editor_data.set_plugin_window_layout(config);
|
editor_data.set_plugin_window_layout(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorNode::_update_dock_slots_visibility() {
|
void EditorNode::_update_dock_slots_visibility(bool p_keep_selected_tabs) {
|
||||||
if (!docks_visible) {
|
if (!docks_visible) {
|
||||||
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
|
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
|
||||||
dock_slot[i]->hide();
|
dock_slot[i]->hide();
|
||||||
@ -4526,9 +4526,11 @@ void EditorNode::_update_dock_slots_visibility() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
|
if (!p_keep_selected_tabs) {
|
||||||
if (dock_slot[i]->is_visible() && dock_slot[i]->get_tab_count()) {
|
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
|
||||||
dock_slot[i]->set_current_tab(0);
|
if (dock_slot[i]->is_visible() && dock_slot[i]->get_tab_count()) {
|
||||||
|
dock_slot[i]->set_current_tab(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5129,7 +5131,7 @@ void EditorNode::_bottom_panel_switch(bool p_enable, int p_idx) {
|
|||||||
|
|
||||||
void EditorNode::set_docks_visible(bool p_show) {
|
void EditorNode::set_docks_visible(bool p_show) {
|
||||||
docks_visible = p_show;
|
docks_visible = p_show;
|
||||||
_update_dock_slots_visibility();
|
_update_dock_slots_visibility(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EditorNode::get_docks_visible() const {
|
bool EditorNode::get_docks_visible() const {
|
||||||
|
@ -895,7 +895,7 @@ private:
|
|||||||
void _load_docks();
|
void _load_docks();
|
||||||
void _save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section);
|
void _save_docks_to_config(Ref<ConfigFile> p_layout, const String &p_section);
|
||||||
void _load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section);
|
void _load_docks_from_config(Ref<ConfigFile> p_layout, const String &p_section);
|
||||||
void _update_dock_slots_visibility();
|
void _update_dock_slots_visibility(bool p_keep_selected_tabs = false);
|
||||||
void _dock_tab_changed(int p_tab);
|
void _dock_tab_changed(int p_tab);
|
||||||
|
|
||||||
bool restoring_scenes;
|
bool restoring_scenes;
|
||||||
|
Loading…
Reference in New Issue
Block a user