Cleanup: indentation
This commit is contained in:
		@@ -397,61 +397,61 @@ class ToolSelectPanelHelper:
 | 
				
			|||||||
        ui_gen.send(None)
 | 
					        ui_gen.send(None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for item in self.tools_from_context(context):
 | 
					        for item in self.tools_from_context(context):
 | 
				
			||||||
                if item is None:
 | 
					            if item is None:
 | 
				
			||||||
                    ui_gen.send(True)
 | 
					                ui_gen.send(True)
 | 
				
			||||||
                    continue
 | 
					                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 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:
 | 
					                    if is_active:
 | 
				
			||||||
                        # not ideal, write this every time :S
 | 
					                        index = i
 | 
				
			||||||
                        self._tool_group_active[item[0].text] = index
 | 
					                        break
 | 
				
			||||||
                    else:
 | 
					                del i, sub_item
 | 
				
			||||||
                        index = self._tool_group_active.get(item[0].text, 0)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    item = item[index]
 | 
					                if is_active:
 | 
				
			||||||
                    use_menu = True
 | 
					                    # not ideal, write this every time :S
 | 
				
			||||||
 | 
					                    self._tool_group_active[item[0].text] = index
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    index = -1
 | 
					                    index = self._tool_group_active.get(item[0].text, 0)
 | 
				
			||||||
                    use_menu = False
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                tool_def, icon_name = ToolSelectPanelHelper._tool_vars_from_def(item, context_mode)
 | 
					                item = item[index]
 | 
				
			||||||
                is_active = (tool_def == tool_def_active)
 | 
					                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:
 | 
					            sub = ui_gen.send(False)
 | 
				
			||||||
                    props = sub.operator_menu_hold(
 | 
					
 | 
				
			||||||
                        "wm.tool_set",
 | 
					            if use_menu:
 | 
				
			||||||
                        text=item.text if show_text else "",
 | 
					                props = sub.operator_menu_hold(
 | 
				
			||||||
                        depress=is_active,
 | 
					                    "wm.tool_set",
 | 
				
			||||||
                        menu="WM_MT_toolsystem_submenu",
 | 
					                    text=item.text if show_text else "",
 | 
				
			||||||
                        icon_value=icon_value,
 | 
					                    depress=is_active,
 | 
				
			||||||
                    )
 | 
					                    menu="WM_MT_toolsystem_submenu",
 | 
				
			||||||
                else:
 | 
					                    icon_value=icon_value,
 | 
				
			||||||
                    props = sub.operator(
 | 
					                )
 | 
				
			||||||
                        "wm.tool_set",
 | 
					            else:
 | 
				
			||||||
                        text=item.text if show_text else "",
 | 
					                props = sub.operator(
 | 
				
			||||||
                        depress=is_active,
 | 
					                    "wm.tool_set",
 | 
				
			||||||
                        icon_value=icon_value,
 | 
					                    text=item.text if show_text else "",
 | 
				
			||||||
                    )
 | 
					                    depress=is_active,
 | 
				
			||||||
                props.keymap = tool_def[0] or ""
 | 
					                    icon_value=icon_value,
 | 
				
			||||||
                props.manipulator_group = tool_def[1] or ""
 | 
					                )
 | 
				
			||||||
                props.data_block = tool_def[2] or ""
 | 
					            props.keymap = tool_def[0] or ""
 | 
				
			||||||
                props.index = index
 | 
					            props.manipulator_group = tool_def[1] or ""
 | 
				
			||||||
 | 
					            props.data_block = tool_def[2] or ""
 | 
				
			||||||
 | 
					            props.index = index
 | 
				
			||||||
        # Signal to finish any remaining layout edits.
 | 
					        # Signal to finish any remaining layout edits.
 | 
				
			||||||
        ui_gen.send(None)
 | 
					        ui_gen.send(None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user