diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-24 23:37:20 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-24 23:37:20 +0200 |
commit | df0a822323a79e1a645f0c6a17d51c7602f23166 (patch) | |
tree | ea4fa4737054f13fe66bec256ca2454159474d3d | |
parent | 7287df46335bb12143ec87d96c0518eedd89e2f9 (diff) | |
parent | 2e28fb7cddb2c481cbfe56a05e6543f23b57e7b9 (diff) | |
download | redot-engine-df0a822323a79e1a645f0c6a17d51c7602f23166.tar.gz |
Merge pull request #82236 from Chubercik/item_list_separator_fix
Remove the separator from ItemList's thumbnails mode
-rw-r--r-- | scene/gui/item_list.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index e1fc7d7cd4..343301e9c4 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1082,14 +1082,16 @@ void ItemList::_notification(int p_what) { first_visible_separator = lo; } - // Draw visible separators. - 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(theme_cache.panel_style->get_margin(SIDE_LEFT), y), Vector2(width, y), theme_cache.guide_color); + const int y = base_ofs.y + separators[i]; + draw_line(Vector2(theme_cache.panel_style->get_margin(SIDE_LEFT), y), Vector2(width, y), theme_cache.guide_color); + } } // Do a binary search to find the first item whose rect reaches below clip.position.y. |