1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Enable scroll hints for several parts of the editor

This commit is contained in:
Michael Alexsander
2025-12-04 13:28:49 -03:00
parent 757bba192e
commit f187b8b2bf
35 changed files with 334 additions and 93 deletions

View File

@@ -484,10 +484,13 @@ void FileSystemDock::_update_display_mode(bool p_force) {
// Compute the new display mode.
if (p_force || old_display_mode != display_mode) {
switch (display_mode) {
case DISPLAY_MODE_TREE_ONLY:
case DISPLAY_MODE_TREE_ONLY: {
button_toggle_display_mode->set_button_icon(get_editor_theme_icon(SNAME("Panels1")));
tree->show();
tree->set_v_size_flags(SIZE_EXPAND_FILL);
tree->set_scroll_hint_mode(Tree::SCROLL_HINT_MODE_TOP);
tree->set_theme_type_variation("");
tree_mc->set_theme_type_variation("NoBorderHorizontalBottom");
if (horizontal) {
toolbar2_hbc->hide();
} else {
@@ -497,10 +500,10 @@ void FileSystemDock::_update_display_mode(bool p_force) {
_update_tree(get_uncollapsed_paths());
file_list_vb->hide();
break;
} break;
case DISPLAY_MODE_HSPLIT:
case DISPLAY_MODE_VSPLIT:
case DISPLAY_MODE_VSPLIT: {
const bool is_vertical = display_mode == DISPLAY_MODE_VSPLIT;
split_box->set_vertical(is_vertical);
@@ -511,15 +514,26 @@ void FileSystemDock::_update_display_mode(bool p_force) {
tree->show();
tree->set_v_size_flags(SIZE_EXPAND_FILL);
if (is_vertical) {
tree->set_theme_type_variation("");
tree->set_scroll_hint_mode(Tree::SCROLL_HINT_MODE_BOTH);
tree_mc->set_theme_type_variation("NoBorderHorizontal");
} else {
tree->set_theme_type_variation("TreeSecondary");
tree->set_scroll_hint_mode(Tree::SCROLL_HINT_MODE_DISABLED);
tree_mc->set_theme_type_variation("");
}
tree->ensure_cursor_is_visible();
toolbar2_hbc->hide();
button_file_list_display_mode->show();
_update_tree(get_uncollapsed_paths());
file_list_vb->show();
_update_file_list(true);
break;
} break;
}
old_display_mode = display_mode;
}
}
@@ -4322,18 +4336,22 @@ FileSystemDock::FileSystemDock() {
split_box_offset_h = 240 * EDSCALE;
main_vb->add_child(split_box);
tree_mc = memnew(MarginContainer);
split_box->add_child(tree_mc);
tree_mc->set_theme_type_variation("NoBorderHorizontalBottom");
tree_mc->set_v_size_flags(Control::SIZE_EXPAND_FILL);
tree = memnew(FileSystemTree);
tree->set_accessibility_name(TTRC("Directories"));
tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
tree->set_hide_root(true);
tree->set_scroll_hint_mode(Tree::SCROLL_HINT_MODE_TOP);
SET_DRAG_FORWARDING_GCD(tree, FileSystemDock);
tree->set_allow_rmb_select(true);
tree->set_select_mode(Tree::SELECT_MULTI);
tree->set_custom_minimum_size(Size2(40 * EDSCALE, 15 * EDSCALE));
tree->set_column_clip_content(0, true);
split_box->add_child(tree);
tree_mc->add_child(tree);
tree->connect("item_activated", callable_mp(this, &FileSystemDock::_tree_activate_file));
tree->connect("multi_selected", callable_mp(this, &FileSystemDock::_tree_multi_selected));