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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-09-09 21:12:47 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-09-09 21:13:34 +0300
commitc2d37929b4aaaef87bad1d2e90cc76d0c4765e8d (patch)
tree0081cce4f53caccb274307618b89c140168bc430 /source/blender/editors/interface/interface_layout.c
parentee9fb174f45d481a5a76522e80bcc9df58e28528 (diff)
Fix T69633: weird behavior of operator_menu_enum tooltips.
For operators with dynamic tooltips the tooltip calculation is deferred until the moment it is actually shown for performance reasons, with the tooltip field left blank for the time being. Enum menu code shouldn't jump in and assign a tooltip either. The menu button itself can't show a dynamic tooltip because it does not actually call the operator, and has no reference to it. As a side change, allow returning None from the python callback as the most natural way to fall back to the default tooltip.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r--source/blender/editors/interface/interface_layout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index e7b6282d2e6..6a707b56f36 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1110,7 +1110,8 @@ void UI_context_active_but_prop_get_filebrowser(const bContext *C,
static void ui_but_tip_from_enum_item(uiBut *but, const EnumPropertyItem *item)
{
if (but->tip == NULL || but->tip[0] == '\0') {
- if (item->description && item->description[0]) {
+ if (item->description && item->description[0] &&
+ !(but->optype && but->optype->get_description)) {
but->tip = item->description;
}
}