Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,9 @@
<member name="interface/editor/automatically_open_screenshots" type="bool" setter="" getter="">
If [code]true[/code], automatically opens screenshots with the default program associated to [code].png[/code] files after a screenshot is taken using the [b]Editor &gt; Take Screenshot[/b] action.
</member>
<member name="interface/editor/bottom_dock_tab_individual_height" type="bool" setter="" getter="">
If the editor docks located at the bottom should have individual heights.
</member>
<member name="interface/editor/bottom_dock_tab_style" type="int" setter="" getter="">
Tab style of editor docks located at the bottom.
</member>
Expand Down
7 changes: 7 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,9 @@ void EditorNode::_notification(int p_what) {
theme->set_constant("dragging_unfold_wait_msec", "Tree", (float)EDITOR_GET("interface/editor/dragging_hover_wait_seconds") * 1000);
theme->set_constant("hover_switch_wait_msec", "TabBar", (float)EDITOR_GET("interface/editor/dragging_hover_wait_seconds") * 1000);
editor_dock_manager->update_tab_styles();

bottom_dock_tab_individual_height = EDITOR_GET("interface/editor/bottom_dock_tab_individual_height");
Comment thread
This conversation was marked as resolved.
Outdated
get_bottom_panel()->_editor_settings_changed();
}

if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/scene_tabs")) {
Expand Down Expand Up @@ -6356,6 +6359,10 @@ bool EditorNode::is_cmdline_mode() {
return singleton->cmdline_mode;
}

bool EditorNode::is_bottom_dock_tab_individual_height() {
return singleton->bottom_dock_tab_individual_height;
}

void EditorNode::cleanup() {
_init_callbacks.clear();
}
Expand Down
3 changes: 3 additions & 0 deletions editor/editor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ class EditorNode : public Node {
Callable palette_file_selected_callback;

EditorBottomPanel *bottom_panel = nullptr;
bool bottom_dock_tab_individual_height = false;

Tree *disk_changed_list = nullptr;
LocalVector<String> disk_changed_scenes;
Expand Down Expand Up @@ -779,6 +780,8 @@ class EditorNode : public Node {

static bool is_cmdline_mode();

static bool is_bottom_dock_tab_individual_height();
Comment thread
This conversation was marked as resolved.
Outdated

static HashMap<String, Variant> get_initial_settings();

static void cleanup();
Expand Down
39 changes: 31 additions & 8 deletions editor/gui/editor_bottom_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,30 @@ void EditorBottomPanel::_theme_changed() {
}
}

void EditorBottomPanel::_editor_settings_changed() {
_update_center_split_offset();
}

void EditorBottomPanel::set_bottom_panel_offset(int p_offset) {
EditorDock *current_tab = Object::cast_to<EditorDock>(get_current_tab_control());
if (current_tab) {
dock_offsets[current_tab->get_effective_layout_key()] = p_offset;
if (EditorNode::get_singleton()->is_bottom_dock_tab_individual_height()) {
// Store the individual offsets
EditorDock *current_tab = Object::cast_to<EditorDock>(get_current_tab_control());
if (current_tab) {
dock_offsets[current_tab->get_effective_layout_key()] = p_offset;
}
} else {
// Store the unified offset
dock_offset = p_offset;
}
}

int EditorBottomPanel::get_bottom_panel_offset() {
// Return the unified height
if (!EditorNode::get_singleton()->is_bottom_dock_tab_individual_height()) {
return dock_offset;
}

// Load the individual tab heights
EditorDock *current_tab = Object::cast_to<EditorDock>(get_current_tab_control());
if (current_tab) {
return dock_offsets[current_tab->get_effective_layout_key()];
Expand Down Expand Up @@ -127,14 +143,21 @@ void EditorBottomPanel::save_layout_to_config(Ref<ConfigFile> p_config_file, con
offsets[E.key] = E.value;
}
p_config_file->set_value(p_section, "bottom_panel_offsets", offsets);
p_config_file->set_value(p_section, "bottom_panel_offset", dock_offset);
}

void EditorBottomPanel::load_layout_from_config(Ref<ConfigFile> p_config_file, const String &p_section) {
const Dictionary offsets = p_config_file->get_value(p_section, "bottom_panel_offsets", Dictionary());
const LocalVector<Variant> offset_list = offsets.get_key_list();

for (const Variant &v : offset_list) {
dock_offsets[v] = offsets[v];
if (EditorNode::get_singleton()->is_bottom_dock_tab_individual_height()) {
// Load the individual offsets
const Dictionary offsets = p_config_file->get_value(p_section, "bottom_panel_offsets", Dictionary());
const LocalVector<Variant> offset_list = offsets.get_key_list();
for (const Variant &v : offset_list) {
dock_offsets[v] = offsets[v];
}
} else {
// Load the unified offset
const int offset = p_config_file->get_value(p_section, "bottom_panel_offset", int());
dock_offset = offset;
Comment thread
This conversation was marked as resolved.
Outdated
}
_update_center_split_offset();
}
Expand Down
2 changes: 2 additions & 0 deletions editor/gui/editor_bottom_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class EditorBottomPanel : public TabContainer {
bool lock_panel_switching = false;
LocalVector<EditorDock *> bottom_docks;
LocalVector<Ref<Shortcut>> dock_shortcuts;
int dock_offset;
Comment thread
This conversation was marked as resolved.
Outdated
HashMap<String, int> dock_offsets;

LocalVector<Button *> legacy_buttons;
Expand Down Expand Up @@ -79,6 +80,7 @@ class EditorBottomPanel : public TabContainer {
void toggle_last_opened_bottom_panel();
void set_expanded(bool p_expanded);
void _theme_changed();
void _editor_settings_changed();

void set_bottom_panel_offset(int p_offset);
int get_bottom_panel_offset();
Expand Down
1 change: 1 addition & 0 deletions editor/settings/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/localize_settings", true, "")
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/dock_tab_style", 0, "Text Only,Icon Only,Text and Icon")
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/bottom_dock_tab_style", 0, "Text Only,Icon Only,Text and Icon")
EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/bottom_dock_tab_individual_height", false, "");
EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/ui_layout_direction", 0, "Based on Application Locale,Left-to-Right,Right-to-Left,Based on System Locale", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)

// Display what the Auto display scale setting effectively corresponds to.
Expand Down