UI: show tool name in tip w/ icon-only display

This commit is contained in:
Campbell Barton 2018-09-04 14:37:19 +10:00
parent 25c1c0455a
commit 113c180902
1 changed files with 11 additions and 0 deletions

View File

@ -390,6 +390,17 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but)
* doesn't have access to information about non-active tools.
*/
/* Title (when icon-only). */
if (but->drawstr[0] == '\0') {
uiTooltipField *field = text_field_add(
data, &(uiTooltipFormat){
.style = UI_TIP_STYLE_NORMAL,
.color_id = UI_TIP_LC_MAIN,
.is_pad = true,
});
field->text = BLI_strdup(tool_name);
}
/* Tip. */
{
const char *expr_imports[] = {"bpy", "bl_ui", NULL};