[Bf-blender-cvs] [aa6946f6c9a] master: UI: Use grid-flow layout throughout Preferences
William Reynish
noreply at git.blender.org
Sun Jan 6 21:54:10 CET 2019
Commit: aa6946f6c9a1e24ea429ad989039e574ac9f14cc
Author: William Reynish
Date: Sun Jan 6 21:51:07 2019 +0100
Branches: master
https://developer.blender.org/rBaa6946f6c9a1e24ea429ad989039e574ac9f14cc
UI: Use grid-flow layout throughout Preferences
Makes the entire Preferences UI nicely width responsive. Also, move
use_tabs_as_spaces option back to file path options, it was too lonely
in its own panel ;)
===================================================================
M release/scripts/startup/bl_ui/space_userpref.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index c1d8f02afe8..489ec261ded 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -116,8 +116,10 @@ class USERPREF_PT_interface_display(PreferencePanel):
prefs = context.preferences
view = prefs.view
- layout.prop(view, "ui_scale", text="Resolution Scale")
- layout.prop(view, "ui_line_width", text="Line Width")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(view, "ui_scale", text="Resolution Scale")
+ flow.prop(view, "ui_line_width", text="Line Width")
class USERPREF_PT_interface_display_info(PreferencePanel):
@@ -128,7 +130,7 @@ class USERPREF_PT_interface_display_info(PreferencePanel):
prefs = context.preferences
view = prefs.view
- flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=False)
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
flow.prop(view, "show_tooltips")
flow.prop(view, "show_object_info", text="Object Info")
@@ -150,13 +152,15 @@ class USERPREF_PT_interface_text(PreferencePanel):
prefs = context.preferences
view = prefs.view
- layout.prop(view, "use_text_antialiasing", text="Anti-aliasing")
- sub = layout.column()
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(view, "use_text_antialiasing", text="Anti-aliasing")
+ sub = flow.column()
sub.active = view.use_text_antialiasing
sub.prop(view, "text_hinting", text="Hinting")
- layout.prop(view, "font_path_ui")
- layout.prop(view, "font_path_ui_mono")
+ flow.prop(view, "font_path_ui")
+ flow.prop(view, "font_path_ui_mono")
class USERPREF_PT_interface_text_translate(PreferencePanel):
@@ -180,11 +184,14 @@ class USERPREF_PT_interface_text_translate(PreferencePanel):
view = prefs.view
layout.active = view.use_international_fonts
- layout.prop(view, "language")
- layout.prop(view, "use_translate_tooltips", text="Translate Tooltips")
- layout.prop(view, "use_translate_interface", text="Translate Interface")
- layout.prop(view, "use_translate_new_dataname", text="Translate New Data")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(view, "language")
+
+ flow.prop(view, "use_translate_tooltips", text="Translate Tooltips")
+ flow.prop(view, "use_translate_interface", text="Translate Interface")
+ flow.prop(view, "use_translate_new_dataname", text="Translate New Data")
class USERPREF_PT_interface_develop(PreferencePanel):
@@ -200,8 +207,10 @@ class USERPREF_PT_interface_develop(PreferencePanel):
prefs = context.preferences
view = prefs.view
- layout.prop(view, "show_tooltips_python")
- layout.prop(view, "show_developer_ui")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(view, "show_tooltips_python")
+ flow.prop(view, "show_developer_ui")
class USERPREF_PT_interface_viewports(PreferencePanel):
@@ -225,18 +234,25 @@ class USERPREF_PT_interface_viewports_3d(PreferencePanel):
prefs = context.preferences
view = prefs.view
- layout.prop(view, "smooth_view")
- layout.prop(view, "rotation_angle")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
- layout.separator()
+ col = flow.column()
- layout.prop(view, "object_origin_size")
- layout.prop(view, "gizmo_size", text="Gizmo Size")
- layout.separator()
+ col.prop(view, "smooth_view")
+ col.prop(view, "rotation_angle")
+ col.separator()
+
+ col = flow.column()
- layout.prop(view, "mini_axis_type", text="3D Viewport Axis")
+ col.prop(view, "object_origin_size")
+ col.prop(view, "gizmo_size", text="Gizmo Size")
+ col.separator()
- sub = layout.column()
+ col = flow.column()
+
+ col.prop(view, "mini_axis_type", text="3D Viewport Axis")
+
+ sub = col.column()
sub.active = view.mini_axis_type == 'MINIMAL'
sub.prop(view, "mini_axis_size", text="Size")
sub.prop(view, "mini_axis_brightness", text="Brightness")
@@ -269,13 +285,15 @@ class USERPREF_PT_interface_viewports_2d(PreferencePanel):
prefs = context.preferences
view = prefs.view
- layout.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing")
- layout.prop(view, "timecode_style")
- layout.prop(view, "view_frame_type")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing")
+ flow.prop(view, "timecode_style")
+ flow.prop(view, "view_frame_type")
if view.view_frame_type == 'SECONDS':
- layout.prop(view, "view_frame_seconds")
+ flow.prop(view, "view_frame_seconds")
elif view.view_frame_type == 'KEYFRAMES':
- layout.prop(view, "view_frame_keyframes")
+ flow.prop(view, "view_frame_keyframes")
class USERPREF_PT_interface_menus(PreferencePanel):
@@ -292,12 +310,13 @@ class USERPREF_PT_interface_menus(PreferencePanel):
view = prefs.view
system = prefs.system
- layout.prop(view, "color_picker_type")
- layout.row().prop(view, "header_align_default", expand=True)
- layout.prop(system, "use_region_overlap")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
- layout.prop(view, "show_splash")
- layout.prop(view, "use_quit_dialog")
+ flow.prop(view, "color_picker_type")
+ flow.row().prop(view, "header_align_default", expand=True)
+ flow.prop(system, "use_region_overlap")
+ flow.prop(view, "show_splash")
+ flow.prop(view, "use_quit_dialog")
class USERPREF_PT_interface_menus_mouse_over(PreferencePanel):
@@ -316,8 +335,10 @@ class USERPREF_PT_interface_menus_mouse_over(PreferencePanel):
layout.active = view.use_mouse_over_open
- layout.prop(view, "open_toplevel_delay", text="Top Level")
- layout.prop(view, "open_sublevel_delay", text="Sub Level")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(view, "open_toplevel_delay", text="Top Level")
+ flow.prop(view, "open_sublevel_delay", text="Sub Level")
class USERPREF_PT_interface_menus_pie(PreferencePanel):
@@ -328,11 +349,13 @@ class USERPREF_PT_interface_menus_pie(PreferencePanel):
prefs = context.preferences
view = prefs.view
- layout.prop(view, "pie_animation_timeout")
- layout.prop(view, "pie_initial_timeout")
- layout.prop(view, "pie_menu_radius")
- layout.prop(view, "pie_menu_threshold")
- layout.prop(view, "pie_menu_confirm")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(view, "pie_animation_timeout")
+ flow.prop(view, "pie_initial_timeout")
+ flow.prop(view, "pie_menu_radius")
+ flow.prop(view, "pie_menu_threshold")
+ flow.prop(view, "pie_menu_confirm")
class USERPREF_PT_interface_templates(PreferencePanel):
@@ -365,9 +388,11 @@ class USERPREF_PT_edit_objects(PreferencePanel):
prefs = context.preferences
edit = prefs.edit
- layout.prop(edit, "material_link", text="Link Materials to")
- layout.prop(edit, "object_align", text="Align New Objects to")
- layout.prop(edit, "use_enter_edit_mode", text="Enter Edit Mode for New Objects")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(edit, "material_link", text="Link Materials to")
+ flow.prop(edit, "object_align", text="Align New Objects to")
+ flow.prop(edit, "use_enter_edit_mode", text="Enter Edit Mode for New Objects")
class USERPREF_PT_edit_animation(PreferencePanel):
@@ -383,10 +408,11 @@ class USERPREF_PT_edit_animation(PreferencePanel):
prefs = context.preferences
edit = prefs.edit
- layout.prop(edit, "use_negative_frames")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
- layout.prop(edit, "use_visual_keying")
- layout.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed")
+ flow.prop(edit, "use_negative_frames")
+ flow.prop(edit, "use_visual_keying")
+ flow.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed")
class USERPREF_PT_edit_animation_autokey(PreferencePanel):
@@ -403,8 +429,10 @@ class USERPREF_PT_edit_animation_autokey(PreferencePanel):
prefs = context.preferences
edit = prefs.edit
- layout.prop(edit, "use_auto_keying_warning")
- layout.prop(edit, "use_keyframe_insert_available", text="Only Insert Available")
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
+
+ flow.prop(edit, "use_auto_keying_warning")
+ flow.prop(edit, "use_keyframe_insert_available", text="Only Insert Available")
class USERPREF_PT_edit_animation_fcurves(PreferencePanel):
@@ -415,13 +443,12 @@ class USERPREF_PT_edit_animation_fcurves(PreferencePanel):
prefs = context.preferences
edit = prefs.edit
- layout.prop(edit, "keyframe_new_interpolation_type", text="Default Interpolation")
- layout.prop(edit, "keyframe_new_handle_type", text="Defau
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list