diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-20 15:46:53 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2016-02-20 16:07:20 +0300 |
commit | 90e77c871b771ad9df23c3e3c9b255d75c409b60 (patch) | |
tree | e3d515ebb4d6f5eb434ae4c797ae363444c06c2b /release | |
parent | 5f613f7b5da945909cdcb452ccec477e20074046 (diff) |
Userpreferences Panel (for the 3DView)
This is an attempt to improve the User preferences panel for the 3DView. I made 2 changes:
- I reordered the sequence of properties by grouping them into more logical groups as it made sense to me. Please indicate where to rearrange the order if necessary.
- Then i added some changes in the code to get the groups better arranged visually. I am pretty sure that this can be done much better, more clever, more generic, whatever. This is just what i could figure out on my own so far.
Reviewers: aligorith, sergey, gaiaclary
Subscribers: sergey
Projects: #user_interface
Maniphest Tasks: T47295
Differential Revision: https://developer.blender.org/D1757
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index e6302ff7bdc..163458ee0fd 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -559,8 +559,33 @@ class USERPREF_PT_theme(Panel): bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} + # not essential, hard-coded UI delimiters for the theme layout + ui_delimiters = { + 'VIEW_3D': { + "text_grease_pencil", + "text_keyframe", + "speaker", + "freestyle_face_mark", + "split_normal", + "bone_solid", + "paint_curve_pivot", + }, + 'GRAPH_EDITOR': { + "handle_vertex_select", + }, + 'IMAGE_EDITOR': { + "paint_curve_pivot", + }, + 'NODE_EDITOR': { + "layout_node", + }, + 'CLIP_EDITOR': { + "handle_vertex_select", + } + } + @staticmethod - def _theme_generic(split, themedata): + def _theme_generic(split, themedata, theme_area): col = split.column() @@ -587,13 +612,30 @@ class USERPREF_PT_theme(Panel): props_type.setdefault((prop.type, prop.subtype), []).append(prop) + th_delimiters = USERPREF_PT_theme.ui_delimiters.get(theme_area) for props_type, props_ls in sorted(props_type.items()): if props_type[0] == 'POINTER': for i, prop in enumerate(props_ls): theme_generic_recurse(getattr(data, prop.identifier)) else: - for i, prop in enumerate(props_ls): - colsub_pair[i % 2].row().prop(data, prop.identifier) + if th_delimiters is None: + # simple, no delimiters + for i, prop in enumerate(props_ls): + colsub_pair[i % 2].row().prop(data, prop.identifier) + else: + # add hard coded delimiters + i = 0 + for prop in props_ls: + colsub = colsub_pair[i] + colsub.row().prop(data, prop.identifier) + i = (i + 1) % 2 + if prop.identifier in th_delimiters: + if i: + colsub = colsub_pair[1] + colsub.row().label("") + colsub_pair[0].row().label("") + colsub_pair[1].row().label("") + i = 0 theme_generic_recurse(themedata) @@ -864,7 +906,7 @@ class USERPREF_PT_theme(Panel): col.label(text="Widget Label:") self._ui_font_style(col, style.widget_label) else: - self._theme_generic(split, getattr(theme, theme.theme_area.lower())) + self._theme_generic(split, getattr(theme, theme.theme_area.lower()), theme.theme_area) class USERPREF_PT_file(Panel): |