Fix [#20602] Cluttered UI in modifiers

Split modifier header on two lines only if available space is low
This commit is contained in:
Matt Ebb
2010-01-20 05:41:59 +00:00
parent 8830528b02
commit 85307388bc
5 changed files with 79 additions and 53 deletions

View File

@@ -20,7 +20,7 @@
import bpy
narrowui = 180
narrowmod = 260
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
@@ -36,14 +36,13 @@ class DATA_PT_modifiers(DataButtonsPanel):
ob = context.object
wide_ui = context.region.width > narrowui
compact_mod = context.region.width < narrowmod
row = layout.row()
row.operator_menu_enum("object.modifier_add", "type")
if wide_ui:
row.label()
for md in ob.modifiers:
box = layout.template_modifier(md)
box = layout.template_modifier(md, compact=compact_mod)
if box:
# match enum type to our functions, avoids a lookup table.
getattr(self, md.type)(box, ob, md, wide_ui)