diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 04:18:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-22 04:19:07 +0300 |
commit | 3e625a7a065592c090e64a2995e90b08bfb53221 (patch) | |
tree | 3882e784de43272e33974a285a0e49a739525b99 /source/blender/editors/interface | |
parent | fb8aa611d0bdfc2942db7d447187d6a731b8c879 (diff) |
UI: hide shortcut from gizmo tip when none found
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_region_tooltip.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index 5782bb466f5..b8cbf7950b7 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -897,22 +897,20 @@ static uiTooltipData *ui_tooltip_data_from_gizmo(bContext *C, wmGizmo *gz) /* Shortcut */ { - bool found = false; IDProperty *prop = gzop->ptr.data; char buf[128]; if (WM_key_event_operator_string( C, gzop->type->idname, WM_OP_INVOKE_DEFAULT, prop, true, buf, ARRAY_SIZE(buf))) { - found = true; + uiTooltipField *field = text_field_add( + data, &(uiTooltipFormat){ + .style = UI_TIP_STYLE_NORMAL, + .color_id = UI_TIP_LC_VALUE, + .is_pad = true, + }); + field->text = BLI_sprintfN(TIP_("Shortcut: %s"), buf); } - uiTooltipField *field = text_field_add( - data, &(uiTooltipFormat){ - .style = UI_TIP_STYLE_NORMAL, - .color_id = UI_TIP_LC_VALUE, - .is_pad = true, - }); - field->text = BLI_sprintfN(TIP_("Shortcut: %s"), found ? buf : "None"); } } } |