Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_userpref.py
| Show First 20 Lines • Show All 586 Lines • ▼ Show 20 Lines | def _theme_generic(split, themedata): | ||||
| props_type.setdefault((prop.type, prop.subtype), []).append(prop) | props_type.setdefault((prop.type, prop.subtype), []).append(prop) | ||||
| for props_type, props_ls in sorted(props_type.items()): | for props_type, props_ls in sorted(props_type.items()): | ||||
| if props_type[0] == 'POINTER': | if props_type[0] == 'POINTER': | ||||
| for i, prop in enumerate(props_ls): | for i, prop in enumerate(props_ls): | ||||
| theme_generic_recurse(getattr(data, prop.identifier)) | theme_generic_recurse(getattr(data, prop.identifier)) | ||||
| else: | else: | ||||
| for i, prop in enumerate(props_ls): | i = 0 | ||||
| colsub_pair[i % 2].row().prop(data, prop.identifier) | for prop in props_ls: | ||||
| colsub = colsub_pair[i % 2] | |||||
| if prop.name.startswith('userpref_section'): | |||||
| if i%2 : | |||||
| colsub.row().label('') | |||||
| colsub_pair[0].row().label('') | |||||
| colsub_pair[1].row().label('') | |||||
| i=0 | |||||
| else: | |||||
| colsub.row().prop(data, prop.identifier) | |||||
| i += 1 | |||||
campbellbarton: Rather keep separate logic here, so common case can be kept understandable.
if… | |||||
| theme_generic_recurse(themedata) | theme_generic_recurse(themedata) | ||||
| @staticmethod | @staticmethod | ||||
| def _theme_widget_style(layout, widget_style): | def _theme_widget_style(layout, widget_style): | ||||
| row = layout.row() | row = layout.row() | ||||
| subsplit = row.split(percentage=0.95) | subsplit = row.split(percentage=0.95) | ||||
| ▲ Show 20 Lines • Show All 820 Lines • Show Last 20 Lines | |||||
Rather keep separate logic here, so common case can be kept understandable.
if th_delimiters is None: old logic else: new complicated logicThis will help make it more clear whats going on if we ever want to re-work the code later.