Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Vazquez <venomgfx@gmail.com>2019-09-12 17:03:49 +0300
committerPablo Vazquez <venomgfx@gmail.com>2019-09-12 17:08:58 +0300
commit2e10cb02fbb9a85f38e9533541318bb3ed23497d (patch)
tree1cde14ff3aa9d24d234dadef5c247e2fb2060223 /release
parentc168092014ef117abb1a6d38c6f6827dab181f09 (diff)
UI: Two-column layout for User Interface theme settings.
Group related settings in columns: * Align Inner, Inner Selected and Outline. * Align Text, Text Selected and Item. Place Shaded settings in its own sub-panel.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py59
1 files changed, 44 insertions, 15 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 14a15ace67e..24586745c4f 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -814,26 +814,21 @@ class PreferenceThemeWidgetColorPanel:
layout.use_property_split = True
- flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+ flow = layout.grid_flow(row_major=False, columns=2, even_columns=True, even_rows=False, align=False)
- col = flow.column()
- col.prop(widget_style, "outline")
+ col = flow.column(align=True)
+ col.prop(widget_style, "text")
+ col.prop(widget_style, "text_sel", text="Selected")
col.prop(widget_style, "item", slider=True)
- col.prop(widget_style, "inner", slider=True)
- col.prop(widget_style, "inner_sel", slider=True)
- col = flow.column()
- col.prop(widget_style, "text")
- col.prop(widget_style, "text_sel")
- col.prop(widget_style, "roundness")
+ col = flow.column(align=True)
+ col.prop(widget_style, "inner", slider=True)
+ col.prop(widget_style, "inner_sel", text="Selected", slider=True)
+ col.prop(widget_style, "outline")
- col = flow.column()
- col.prop(widget_style, "show_shaded")
+ col.separator()
- colsub = col.column()
- colsub.active = widget_style.show_shaded
- colsub.prop(widget_style, "shadetop")
- colsub.prop(widget_style, "shadedown")
+ col.prop(widget_style, "roundness")
@classmethod
def poll(cls, context):
@@ -841,6 +836,31 @@ class PreferenceThemeWidgetColorPanel:
return (prefs.active_section == 'THEMES')
+class PreferenceThemeWidgetShadePanel:
+ bl_space_type = 'PREFERENCES'
+ bl_region_type = 'WINDOW'
+
+ def draw(self, context):
+ theme = context.preferences.themes[0]
+ ui = theme.user_interface
+ widget_style = getattr(ui, self.wcol)
+ layout = self.layout
+
+ layout.use_property_split = True
+
+ col = layout.column(align=True)
+ col.active = widget_style.show_shaded
+ col.prop(widget_style, "shadetop", text="Shade Top")
+ col.prop(widget_style, "shadedown", text="Down")
+
+ def draw_header(self, context):
+ theme = context.preferences.themes[0]
+ ui = theme.user_interface
+ widget_style = getattr(ui, self.wcol)
+
+ self.layout.prop(widget_style, "show_shaded", text="")
+
+
class USERPREF_PT_theme_interface_state(PreferencePanel, Panel):
bl_label = "State"
bl_options = {'DEFAULT_CLOSED'}
@@ -1137,6 +1157,15 @@ class ThemeGenericClassGenerator():
"wcol": wcol,
})
+ panel_shade_id = "USERPREF_PT_theme_interface_shade_" + wcol
+ yield type(panel_shade_id, (PreferenceThemeWidgetShadePanel, Panel), {
+ "bl_label": "Shaded",
+ "bl_options": {'DEFAULT_CLOSED'},
+ "bl_parent_id": panel_id,
+ "draw": PreferenceThemeWidgetShadePanel.draw,
+ "wcol": wcol,
+ })
+
@staticmethod
def generate_theme_area_child_panel_classes(parent_id, rna_type, theme_area, datapath):
def generate_child_panel_classes_recurse(parent_id, rna_type, theme_area, datapath):