diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-01 13:46:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-01 13:48:35 +0300 |
commit | 3f4a81232a2ab3da4802c77c0b7dcbe49f223cbd (patch) | |
tree | 0c785edc0184132730c6d74f706c00bd2c051df8 | |
parent | f38fbc9bedb37695c4936838c002a389c45e367e (diff) |
UI: expose radial gradient as option
Was a separate tool, use option so we can extend more easily.
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 2f0af9ebcb3..c621e27ae00 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -635,28 +635,20 @@ class _defs_weight_paint: ) @ToolDef.from_fn - def gradient_linear(): - return dict( - text="Linear Gradient", - icon="ops.paint.weight_gradient.linear", - widget=None, - keymap=( - ("paint.weight_gradient", dict(type='LINEAR'), - dict(type='EVT_TWEAK_A', value='ANY')), - ), - ) + def gradient(): + def draw_settings(context, layout): + wm = context.window_manager + props = wm.operator_properties_last("paint.weight_gradient") + layout.prop(props, "type") - @ToolDef.from_fn - def gradient_radial(): return dict( - text="Radial Gradient", - icon="ops.paint.weight_gradient.radial", + text="Gradient", + icon="ops.paint.weight_gradient", widget=None, keymap=( - ("paint.weight_gradient", - dict(type='RADIAL'), - dict(type='EVT_TWEAK_A', value='ANY')), + ("paint.weight_gradient", dict(), dict(type='EVT_TWEAK_A', value='ANY')), ), + draw_settings=draw_settings, ) @@ -800,10 +792,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): # TODO, override brush events *_tools_select, None, - ( - _defs_weight_paint.gradient_linear, - _defs_weight_paint.gradient_radial, - ), + _defs_weight_paint.gradient, ], } |