UI: Simplified Hover on Tool Items #112113

Merged
Harley Acheson merged 1 commits from Harley/blender:ToolOnlyHighlight into main 2023-09-08 02:27:46 +02:00
2 changed files with 5 additions and 7 deletions

View File

@ -9115,13 +9115,6 @@ void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but)
void ui_but_activate_over(bContext *C, ARegion *region, uiBut *but)
{
/* If there is an active button in the currently active region,
* then add UI_SELECT_DRAW to the to-be-activated button. */
ARegion *active_region = CTX_wm_region(C);
if (active_region && ui_region_find_active_but(active_region)) {
but->flag |= UI_SELECT_DRAW;
}
button_activate_init(C, region, but, BUTTON_ACTIVATE_OVER);
}

View File

@ -344,6 +344,11 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
* to be within the window bounds may move it away from the mouse,
* This ensures we set an item to be active. */
if (but_activate) {
ARegion *region = CTX_wm_region(C);
if (region && region->regiontype == RGN_TYPE_TOOLS) {
/* In Toolbars, highlight the button with select color. */
but_activate->flag |= UI_SELECT_DRAW;
}
ui_but_activate_over(C, handle->region, but_activate);
}