Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -983,6 +983,9 @@
Expanding main editor window content to the title, if supported by [DisplayServer]. See [constant DisplayServer.WINDOW_FLAG_EXTEND_TO_TITLE].
Specific to the macOS platform.
</member>
<member name="interface/editor/appearance/max_sticky_tree_items" type="int" setter="" getter="">
The maximum number of tree items allowed to stick to the top while its children are in view. A value of [code]0[/code] disables sticking.
</member>
<member name="interface/editor/appearance/project_manager_screen" type="int" setter="" getter="">
The preferred monitor to display the project manager.
</member>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/Tree.xml
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@
<theme_item name="scroll_border" data_type="constant" type="int" default="4">
The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging.
</theme_item>
<theme_item name="scroll_max_sticky_items" data_type="constant" type="int" default="0">
The maximum number of tree items allowed to stick to the top while its children are in view. A value of [code]0[/code] disables sticking.
</theme_item>
<theme_item name="scroll_speed" data_type="constant" type="int" default="12">
The speed of border scrolling.
</theme_item>
Expand Down
2 changes: 1 addition & 1 deletion editor/settings/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
#include "scene/gui/file_dialog.h"
#include "scene/main/node.h"
#include "scene/main/scene_tree.h"
#include "scene/main/window.h"
#include "scene/resources/animation.h"
#include "servers/display/display_server.h"

Expand Down Expand Up @@ -506,6 +505,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/appearance/use_embedded_menu", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_EDITOR_BASIC_SETTING)
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/appearance/use_native_file_dialogs", false, "", PROPERTY_USAGE_DEFAULT)
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/appearance/expand_to_title", true, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING)
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/appearance/max_sticky_tree_items", 6, "0,16")

EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/fonts/main_font_size", 14, "8,48,1")
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_RANGE, "interface/editor/fonts/code_font_size", 14, "8,48,1")
Expand Down
2 changes: 2 additions & 0 deletions editor/themes/editor_theme_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ EditorThemeManager::ThemeConfiguration EditorThemeManager::_create_theme_config(
config.gizmo_handle_scale = EDITOR_GET("interface/touchscreen/scale_gizmo_handles");
config.subresource_hue_tint = EDITOR_GET("docks/property_editor/subresource_hue_tint");
config.dragging_hover_wait_msec = (float)EDITOR_GET("interface/editor/timers/dragging_hover_wait_seconds") * 1000;
config.max_sticky_tree_items = EDITOR_GET("interface/editor/appearance/max_sticky_tree_items");

// Handle theme style.
if (config.preset != "Custom") {
Expand Down Expand Up @@ -718,6 +719,7 @@ bool EditorThemeManager::is_generated_theme_outdated() {
// TODO: We can use this information more intelligently to do partial theme updates and speed things up.
outdated_cache = EditorSettings::get_singleton()->check_changed_settings_in_group("interface/theme") ||
EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/fonts") ||
EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/appearance/max_sticky_tree_items") ||
EditorSettings::get_singleton()->check_changed_settings_in_group("interface/touchscreen/enable_touch_optimizations") ||
EditorSettings::get_singleton()->check_changed_settings_in_group("editors/visual_editors") ||
EditorSettings::get_singleton()->check_changed_settings_in_group("text_editor/theme") ||
Expand Down
1 change: 1 addition & 0 deletions editor/themes/editor_theme_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class EditorThemeManager {
int inspector_property_height = 28;
float subresource_hue_tint = 0.0;
float dragging_hover_wait_msec = 0;
int max_sticky_tree_items = 5;

// Make sure to keep those in sync with the definitions in the editor settings.
const float default_icon_saturation = 2.0;
Expand Down
1 change: 1 addition & 0 deletions editor/themes/theme_classic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ void ThemeClassic::populate_standard_styles(const Ref<EditorTheme> &p_theme, Edi
p_theme->set_constant("icon_h_separation", "Tree", (p_config.increased_margin + 2) * EDSCALE);
p_theme->set_constant("button_margin", "Tree", p_config.base_margin * EDSCALE);
p_theme->set_constant("dragging_unfold_wait_msec", "Tree", p_config.dragging_hover_wait_msec);
p_theme->set_constant("scroll_max_sticky_items", "Tree", p_config.max_sticky_tree_items);
p_theme->set_constant("scroll_border", "Tree", 40 * EDSCALE);
p_theme->set_constant("scroll_speed", "Tree", 12);
p_theme->set_constant("outline_size", "Tree", 0);
Expand Down
1 change: 1 addition & 0 deletions editor/themes/theme_modern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ void ThemeModern::populate_standard_styles(const Ref<EditorTheme> &p_theme, Edit
p_theme->set_constant("icon_h_separation", "Tree", p_config.base_margin * 1.5 * EDSCALE);
p_theme->set_constant("button_margin", "Tree", p_config.base_margin * EDSCALE);
p_theme->set_constant("dragging_unfold_wait_msec", "Tree", p_config.dragging_hover_wait_msec);
p_theme->set_constant("scroll_max_sticky_items", "Tree", p_config.max_sticky_tree_items);
p_theme->set_constant("scroll_border", "Tree", 40 * EDSCALE);
p_theme->set_constant("scroll_speed", "Tree", 12);
p_theme->set_constant("outline_size", "Tree", 0);
Expand Down
Loading