diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-18 09:41:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-18 09:50:18 +0300 |
commit | b749e43cd3e2a76a58f3fb7b47959b684061ea9b (patch) | |
tree | a76ade362ffaa3bbb2342ed3c0fa31761363fb32 /source/blender/editors/interface/interface_eyedropper_colorband.c | |
parent | 8f5ba8e1a1df2e496bbf24573a68cffe564e24db (diff) |
Fix color ramp eyedropper menu item
This couldn't be accessed because the poll function was checking the
active button.
Add a "color_ramp" context pointer which is set by the menu.
Alternative fix to D3984
Diffstat (limited to 'source/blender/editors/interface/interface_eyedropper_colorband.c')
-rw-r--r-- | source/blender/editors/interface/interface_eyedropper_colorband.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_eyedropper_colorband.c b/source/blender/editors/interface/interface_eyedropper_colorband.c index 98dbb31d049..8e588352b56 100644 --- a/source/blender/editors/interface/interface_eyedropper_colorband.c +++ b/source/blender/editors/interface/interface_eyedropper_colorband.c @@ -97,6 +97,13 @@ static bool eyedropper_colorband_init(bContext *C, wmOperator *op) } if (!band) { + PointerRNA ptr = CTX_data_pointer_get_type(C, "color_ramp", &RNA_ColorRamp); + if (ptr.data != NULL) { + band = ptr.data; + } + } + + if (!band) { return false; } @@ -300,7 +307,14 @@ static int eyedropper_colorband_exec(bContext *C, wmOperator *op) static bool eyedropper_colorband_poll(bContext *C) { uiBut *but = UI_context_active_but_get(C); - return (but && but->type == UI_BTYPE_COLORBAND); + if (but && but->type == UI_BTYPE_COLORBAND) { + return true; + } + PointerRNA ptr = CTX_data_pointer_get_type(C, "color_ramp", &RNA_ColorRamp); + if (ptr.data != NULL) { + return true; + } + return false; } |