[Bf-blender-cvs] [113c180902c] blender2.8: UI: show tool name in tip w/ icon-only display
Campbell Barton
noreply at git.blender.org
Tue Sep 4 06:29:29 CEST 2018
Commit: 113c180902cb112091dbf997beaff29884735b96
Author: Campbell Barton
Date: Tue Sep 4 14:37:19 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB113c180902cb112091dbf997beaff29884735b96
UI: show tool name in tip w/ icon-only display
===================================================================
M source/blender/editors/interface/interface_region_tooltip.c
===================================================================
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c
index 762fc3a946d..6f78fb09ff1 100644
--- a/source/blender/editors/interface/interface_region_tooltip.c
+++ b/source/blender/editors/interface/interface_region_tooltip.c
@@ -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};
More information about the Bf-blender-cvs
mailing list