From 6637dc28f6330ce8f040ba1909274b3251515128 Mon Sep 17 00:00:00 2001 From: Jakub Marcowski <37378746+Chubercik@users.noreply.github.com> Date: Sat, 28 Oct 2023 16:42:23 +0200 Subject: [PATCH] Remove the separator from `ItemList`'s thumbnail mode --- scene/gui/item_list.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 55916243ed4..12a6ea50936 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1155,13 +1155,16 @@ void ItemList::_notification(int p_what) { first_visible_separator = lo; } - for (int i = first_visible_separator; i < separators.size(); i++) { - if (separators[i] > clip.position.y + clip.size.y) { - break; // done - } + // If not in thumbnails mode, draw visible separators. + if (icon_mode != ICON_MODE_TOP) { + for (int i = first_visible_separator; i < separators.size(); i++) { + if (separators[i] > clip.position.y + clip.size.y) { + break; // done + } - const int y = base_ofs.y + separators[i]; - draw_line(Vector2(bg->get_margin(MARGIN_LEFT), y), Vector2(width, y), guide_color); + const int y = base_ofs.y + separators[i]; + draw_line(Vector2(bg->get_margin(MARGIN_LEFT), y), Vector2(width, y), guide_color); + } } } }