UI: Draw subtle background for preview items in menus

Draw a subtle background to make individual parts of each item feel more
connected. E.g. showing loading icons or labels might make it feel like
a bunch of floating icons/labels.

Suggested in #133880.

Pull Request: https://projects.blender.org/blender/blender/pulls/133980
This commit is contained in:
Julian Eisel
2025-02-03 16:11:55 +01:00
committed by Julian Eisel
parent 1f88645728
commit 4755503356

View File

@@ -2750,6 +2750,12 @@ static void widget_state_menu_item(uiWidgetType *wt,
wt->wcol.inner[3] = 255;
wt->wcol.text[3] = 255;
}
/* Subtle background for larger preview buttons, so text and icons feel connected (esp. for while
* previews are loading still and a loading icon is displayed). */
else if (state->but_flag & UI_BUT_ICON_PREVIEW) {
copy_v3_v3_uchar(wt->wcol.inner, wt->wcol.text);
wt->wcol.inner[3] = 11;
}
}
/** \} */