UI: Adjust Layout on Quick Setup Screen
Some items on the Quick Setup screen can be truncated with some languages and/or with High DPI monitors. This patch adjusts column sizes and turns off the expand on Spacebar options, making everything fit a bit better. See D9853 for more details. Differential Revision: https://developer.blender.org/D9853 Reviewed by Julian Eisel
This commit is contained in:
@@ -2961,93 +2961,75 @@ class WM_MT_splash_quick_setup(Menu):
|
|||||||
bl_label = "Quick Setup"
|
bl_label = "Quick Setup"
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
wm = context.window_manager
|
|
||||||
# prefs = context.preferences
|
|
||||||
|
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
layout.operator_context = 'EXEC_DEFAULT'
|
layout.operator_context = 'EXEC_DEFAULT'
|
||||||
|
|
||||||
layout.label(text="Quick Setup")
|
layout.label(text="Quick Setup")
|
||||||
|
|
||||||
split = layout.split(factor=0.25)
|
split = layout.split(factor=0.14) # Left margin.
|
||||||
split.label()
|
split.label()
|
||||||
split = split.split(factor=2.0 / 3.0)
|
split = split.split(factor=0.73) # Content width.
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
|
|
||||||
if bpy.app.build_options.international:
|
col.use_property_split = True
|
||||||
sub = col.split(factor=0.35)
|
col.use_property_decorate = False
|
||||||
row = sub.row()
|
|
||||||
row.alignment = 'RIGHT'
|
|
||||||
row.label(text="Language")
|
|
||||||
prefs = context.preferences
|
|
||||||
sub.prop(prefs.view, "language", text="")
|
|
||||||
|
|
||||||
|
# Languages.
|
||||||
|
if bpy.app.build_options.international:
|
||||||
|
prefs = context.preferences
|
||||||
|
col.prop(prefs.view, "language")
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
sub = col.split(factor=0.35)
|
# Shortcuts.
|
||||||
row = sub.row()
|
wm = context.window_manager
|
||||||
row.alignment = 'RIGHT'
|
kc = wm.keyconfigs.active
|
||||||
row.label(text="Shortcuts")
|
kc_prefs = kc.preferences
|
||||||
text = bpy.path.display_name(wm.keyconfigs.active.name)
|
|
||||||
|
sub = col.column(heading="Shortcuts")
|
||||||
|
text = bpy.path.display_name(kc.name)
|
||||||
if not text:
|
if not text:
|
||||||
text = "Blender"
|
text = "Blender"
|
||||||
sub.menu("USERPREF_MT_keyconfigs", text=text)
|
sub.menu("USERPREF_MT_keyconfigs", text=text)
|
||||||
|
|
||||||
kc = wm.keyconfigs.active
|
|
||||||
kc_prefs = kc.preferences
|
|
||||||
has_select_mouse = hasattr(kc_prefs, "select_mouse")
|
has_select_mouse = hasattr(kc_prefs, "select_mouse")
|
||||||
if has_select_mouse:
|
if has_select_mouse:
|
||||||
sub = col.split(factor=0.35)
|
col.row().prop(kc_prefs, "select_mouse", text="Select With", expand=True)
|
||||||
row = sub.row()
|
|
||||||
row.alignment = 'RIGHT'
|
|
||||||
row.label(text="Select With")
|
|
||||||
sub.row().prop(kc_prefs, "select_mouse", expand=True)
|
|
||||||
has_select_mouse = True
|
|
||||||
|
|
||||||
has_spacebar_action = hasattr(kc_prefs, "spacebar_action")
|
has_spacebar_action = hasattr(kc_prefs, "spacebar_action")
|
||||||
if has_spacebar_action:
|
if has_spacebar_action:
|
||||||
sub = col.split(factor=0.35)
|
col.row().prop(kc_prefs, "spacebar_action", text="Spacebar")
|
||||||
row = sub.row()
|
|
||||||
row.alignment = 'RIGHT'
|
|
||||||
row.label(text="Spacebar")
|
|
||||||
sub.row().prop(kc_prefs, "spacebar_action", expand=True)
|
|
||||||
has_select_mouse = True
|
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
sub = col.split(factor=0.35)
|
# Themes.
|
||||||
row = sub.row()
|
sub = col.column(heading="Theme")
|
||||||
row.alignment = 'RIGHT'
|
|
||||||
row.label(text="Theme")
|
|
||||||
label = bpy.types.USERPREF_MT_interface_theme_presets.bl_label
|
label = bpy.types.USERPREF_MT_interface_theme_presets.bl_label
|
||||||
if label == "Presets":
|
if label == "Presets":
|
||||||
label = "Blender Dark"
|
label = "Blender Dark"
|
||||||
sub.menu("USERPREF_MT_interface_theme_presets", text=label)
|
sub.menu("USERPREF_MT_interface_theme_presets", text=label)
|
||||||
|
|
||||||
# Keep height constant
|
# Keep height constant.
|
||||||
if not has_select_mouse:
|
if not has_select_mouse:
|
||||||
col.label()
|
col.label()
|
||||||
if not has_spacebar_action:
|
if not has_spacebar_action:
|
||||||
col.label()
|
col.label()
|
||||||
|
|
||||||
layout.label()
|
layout.separator(factor=2.0)
|
||||||
|
|
||||||
row = layout.row()
|
# Save settings buttons.
|
||||||
|
sub = layout.row()
|
||||||
|
|
||||||
sub = row.row()
|
|
||||||
old_version = bpy.types.PREFERENCES_OT_copy_prev.previous_version()
|
old_version = bpy.types.PREFERENCES_OT_copy_prev.previous_version()
|
||||||
if bpy.types.PREFERENCES_OT_copy_prev.poll(context) and old_version:
|
if bpy.types.PREFERENCES_OT_copy_prev.poll(context) and old_version:
|
||||||
sub.operator("preferences.copy_prev", text=iface_("Load %d.%d Settings", "Operator") % old_version)
|
sub.operator("preferences.copy_prev", text="Load %d.%d Settings" % old_version)
|
||||||
sub.operator("wm.save_userpref", text="Save New Settings")
|
sub.operator("wm.save_userpref", text="Save New Settings")
|
||||||
else:
|
else:
|
||||||
sub.label()
|
sub.label()
|
||||||
sub.label()
|
sub.label()
|
||||||
sub.operator("wm.save_userpref", text="Next")
|
sub.operator("wm.save_userpref", text="Next")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator(factor=2.4)
|
||||||
layout.separator()
|
|
||||||
|
|
||||||
|
|
||||||
class WM_MT_splash(Menu):
|
class WM_MT_splash(Menu):
|
||||||
|
|||||||
Reference in New Issue
Block a user