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
This commit is contained in:

committed by
Gaia Clary

parent
5f613f7b5d
commit
90e77c871b
@@ -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):
|
||||
|
Reference in New Issue
Block a user