WIP: UI: TreeView Item Drag Padding #111032

Closed
Harley Acheson wants to merge 2 commits from Harley/blender:TreeDragPadding into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 14 additions and 0 deletions

View File

@ -300,6 +300,16 @@ uiBut *ui_but_find_mouse_over_ex(const ARegion *region,
butover = but;
break;
}
else if (ELEM(but->type, UI_BTYPE_LISTROW, UI_BTYPE_VIEW_ITEM)) {
/* Could be in the gaps between these items. */
const uiStyle *style = UI_style_get_dpi();
rctf rect = but->rect;
BLI_rctf_pad(&rect, 0.0f, style->buttonspacey / 2.0f);
if (BLI_rctf_isect_pt(&rect, mx, my)) {
butover = but;
break;
}
}
}
}

View File

@ -456,6 +456,10 @@ std::optional<rctf> AbstractTreeViewItem::get_win_rect(const ARegion &region) co
rctf win_rect;
ui_block_to_window_rctf(&region, item_but->block, &win_rect, &item_but->rect);
/* Expand to include the gaps in between items. */
const uiStyle *style = UI_style_get_dpi();
BLI_rctf_pad(&win_rect, 0.0f, style->buttonspacey / 2.0f);
return win_rect;
}