Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-26 13:19:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-26 13:19:51 +0400
commit06ae122f604a00ebe57903439a2a0cedd0f3ffca (patch)
treef60aa309927c5f86a43ee1629dab0e01bd7685d9 /source/blender/editors
parent7c9033d606a35dd4311e9f84b06b013e5cb7712a (diff)
include menu ID's in tooltips when python tips are enabled, there was no way to find the ID of a menu which become annoying if you wanted to reference it from a script.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_regions.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 62043f240e4..9e7717260e6 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -484,6 +484,17 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
}
}
}
+ else if (ELEM(but->type, MENU, PULLDOWN)) {
+ if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
+ if(but->menu_create_func && WM_menutype_contains((MenuType *)but->poin)) {
+ MenuType *mt= (MenuType *)but->poin;
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", mt->idname);
+ data->color[data->totline]= 0x888888;
+ data->totline++;
+ }
+ }
+
+ }
assert(data->totline < MAX_TOOLTIP_LINES);