diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-13 09:32:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-13 09:32:47 +0300 |
commit | 03281c080c07fcd6a985265c777bde9c5ea500ab (patch) | |
tree | c9ae4315c788783302b1c77dd5bf5eebf9ad1322 /release | |
parent | 0414b0a0be9f38aa87173428b895cf75b1a27c1a (diff) |
Cleanup: indentation
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_common.py | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index dad0ad348e4..9a9e86f6871 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -397,61 +397,61 @@ class ToolSelectPanelHelper: ui_gen.send(None) for item in self.tools_from_context(context): - if item is None: - ui_gen.send(True) - continue - - if type(item) is tuple: - is_active = False - i = 0 - for i, sub_item in enumerate(item): - if sub_item is None: - continue - tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(sub_item, context_mode) - is_active = (tool_def == tool_def_active) - if is_active: - index = i - break - del i, sub_item + if item is None: + ui_gen.send(True) + continue + if type(item) is tuple: + is_active = False + i = 0 + for i, sub_item in enumerate(item): + if sub_item is None: + continue + tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(sub_item, context_mode) + is_active = (tool_def == tool_def_active) if is_active: - # not ideal, write this every time :S - self._tool_group_active[item[0].text] = index - else: - index = self._tool_group_active.get(item[0].text, 0) + index = i + break + del i, sub_item - item = item[index] - use_menu = True + if is_active: + # not ideal, write this every time :S + self._tool_group_active[item[0].text] = index else: - index = -1 - use_menu = False + index = self._tool_group_active.get(item[0].text, 0) - tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(item, context_mode) - is_active = (tool_def == tool_def_active) + item = item[index] + use_menu = True + else: + index = -1 + use_menu = False - icon_value = ToolSelectPanelHelper._icon_value_from_icon_handle(icon_name) + tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(item, context_mode) + is_active = (tool_def == tool_def_active) - sub = ui_gen.send(False) + icon_value = ToolSelectPanelHelper._icon_value_from_icon_handle(icon_name) - if use_menu: - props = sub.operator_menu_hold( - "wm.tool_set", - text=item.text if show_text else "", - depress=is_active, - menu="WM_MT_toolsystem_submenu", - icon_value=icon_value, - ) - else: - props = sub.operator( - "wm.tool_set", - text=item.text if show_text else "", - depress=is_active, - icon_value=icon_value, - ) - props.keymap = tool_def[0] or "" - props.manipulator_group = tool_def[1] or "" - props.data_block = tool_def[2] or "" - props.index = index + sub = ui_gen.send(False) + + if use_menu: + props = sub.operator_menu_hold( + "wm.tool_set", + text=item.text if show_text else "", + depress=is_active, + menu="WM_MT_toolsystem_submenu", + icon_value=icon_value, + ) + else: + props = sub.operator( + "wm.tool_set", + text=item.text if show_text else "", + depress=is_active, + icon_value=icon_value, + ) + props.keymap = tool_def[0] or "" + props.manipulator_group = tool_def[1] or "" + props.data_block = tool_def[2] or "" + props.index = index # Signal to finish any remaining layout edits. ui_gen.send(None) |