Now EditorFilesystemDock will apply the split_mode setting immediately. Also smaller fixes.

This commit is contained in:
Relintai 2023-10-20 21:19:54 +02:00
parent 4628e5354e
commit 4b29c01fdc
3 changed files with 9 additions and 4 deletions

View File

@ -432,7 +432,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["docks/filesystem/dock_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/dock_mode", PROPERTY_HINT_ENUM, "Dock,Bottom Bar", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
_initial_set("docks/filesystem/split_mode", 0);
hints["docks/filesystem/split_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/split_mode", PROPERTY_HINT_ENUM, "Vertical,Horizontal", PROPERTY_USAGE_DEFAULT);
hints["docks/filesystem/split_mode"] = PropertyInfo(Variant::INT, "docks/filesystem/split_mode", PROPERTY_HINT_ENUM, "Horizontal,Vertical", PROPERTY_USAGE_DEFAULT);
// Property editor
_initial_set("docks/property_editor/auto_refresh_interval", 0.3);

View File

@ -467,6 +467,11 @@ void FileSystemDock::_notification(int p_what) {
_update_file_list(true);
}
SplitMode new_split_mode = SplitMode(int(EditorSettings::get_singleton()->get("docks/filesystem/split_mode")));
if (new_split_mode != split_mode) {
set_split_mode(new_split_mode);
}
// Change full tree mode.
_update_display_mode();
} break;
@ -2034,9 +2039,9 @@ void FileSystemDock::set_split_mode(SplitMode p_split_mode) {
split_mode = p_split_mode;
if (split_mode == SPLIT_MODE_HORIZONTAL) {
split_box->set_mode(CSplitContainer::CONTAINER_MODE_HORIZONTAL);
} else {
split_box->set_mode(CSplitContainer::CONTAINER_MODE_VERTICAL);
} else {
split_box->set_mode(CSplitContainer::CONTAINER_MODE_HORIZONTAL);
}
}
FileSystemDock::SplitMode FileSystemDock::get_split_mode() {

View File

@ -86,8 +86,8 @@ public:
};
enum SplitMode {
SPLIT_MODE_HORIZONTAL = 0,
SPLIT_MODE_VERTICAL,
SPLIT_MODE_HORIZONTAL,
};
enum DockMode {