Draw guide lines over selection and focus styleboxes

This commit is contained in:
danielgsilva
2025-07-08 11:30:40 +01:00
parent 4d1f26e1fd
commit 3b17450261

View File

@ -2314,14 +2314,6 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
cell_rect.size.x += theme_cache.h_separation;
}
if (theme_cache.draw_guides) {
Rect2 r = cell_rect;
if (rtl) {
r.position.x = get_size().width - r.position.x - r.size.x;
}
RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(r.position.x, r.position.y + r.size.height), r.position + r.size, theme_cache.guide_color, 1);
}
if (i == 0 && select_mode == SELECT_ROW) {
if (p_item->cells[0].selected || is_row_hovered) {
const Rect2 content_rect = _get_content_rect();
@ -2398,6 +2390,14 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
}
if (theme_cache.draw_guides) {
Rect2 r = cell_rect;
if (rtl) {
r.position.x = get_size().width - r.position.x - r.size.x;
}
RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(r.position.x, r.position.y + r.size.height), r.position + r.size, theme_cache.guide_color, 1);
}
if (p_item->cells[i].custom_bg_color) {
Rect2 r = cell_rect;
if (i == 0) {