Skip to content

Commit 21c315e

Browse files
committed
Merge pull request godotengine#82236 from Chubercik/item_list_separator_fix
Remove the separator from ItemList's thumbnails mode
2 parents ec4b07c + 2742275 commit 21c315e

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

scene/gui/item_list.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,14 +1082,16 @@ void ItemList::_notification(int p_what) {
10821082
first_visible_separator = lo;
10831083
}
10841084

1085-
// Draw visible separators.
1086-
for (int i = first_visible_separator; i < separators.size(); i++) {
1087-
if (separators[i] > clip.position.y + clip.size.y) {
1088-
break; // done
1089-
}
1085+
// If not in thumbnails mode, draw visible separators.
1086+
if (icon_mode != ICON_MODE_TOP) {
1087+
for (int i = first_visible_separator; i < separators.size(); i++) {
1088+
if (separators[i] > clip.position.y + clip.size.y) {
1089+
break; // done
1090+
}
10901091

1091-
const int y = base_ofs.y + separators[i];
1092-
draw_line(Vector2(theme_cache.panel_style->get_margin(SIDE_LEFT), y), Vector2(width, y), theme_cache.guide_color);
1092+
const int y = base_ofs.y + separators[i];
1093+
draw_line(Vector2(theme_cache.panel_style->get_margin(SIDE_LEFT), y), Vector2(width, y), theme_cache.guide_color);
1094+
}
10931095
}
10941096

10951097
// Do a binary search to find the first item whose rect reaches below clip.position.y.

0 commit comments

Comments
 (0)