Implemented suggestion be Matt to slightly tweak the code for single column UI
authorWilliam Reynish <william@reynish.com>
Thu, 12 Nov 2009 13:05:12 +0000 (13:05 +0000)
committerWilliam Reynish <william@reynish.com>
Thu, 12 Nov 2009 13:05:12 +0000 (13:05 +0000)
release/scripts/ui/properties_material.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_world.py

index 61ce917180f77dd4a40d031798530b09a24d385a..8cdc53a50946b0ce1631b424c6d653cd64f0ca1f 100644 (file)
@@ -73,6 +73,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
         ob = context.object
         slot = context.material_slot
         space = context.space_data
+        col2 = context.region.width > narrowui
 
         if ob:
             row = layout.row()
@@ -90,7 +91,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
                 row.itemO("object.material_slot_select", text="Select")
                 row.itemO("object.material_slot_deselect", text="Deselect")
 
-        if (context.region.width > narrowui):
+        if col2:
             split = layout.split(percentage=0.65)
     
             if ob:
@@ -107,7 +108,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
             layout.template_ID(ob, "active_material", new="material.new")
 
         if mat:
-            if (context.region.width > narrowui):
+            if col2:
                 layout.itemR(mat, "type", expand=True)
             else:
                 layout.itemR(mat, "type", text="")
@@ -126,6 +127,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         if mat.type in ('SURFACE', 'WIRE'):
             split = layout.split()
@@ -138,7 +140,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
             sub = col.column()
             sub.itemR(mat, "translucency")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "shadeless")
             sub = col.column()
@@ -165,6 +167,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
 
         mat = context.material # dont use node material
         tan = mat.strand
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -180,7 +183,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
         sub.itemR(tan, "tangent_shading")
         col.itemR(tan, "shape")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL(text="Shading:")
         col.itemR(tan, "width_fade")
@@ -206,7 +209,8 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
         layout = self.layout
 
         phys = context.material.physics # dont use node material
-
+        col2 = context.region.width > narrowui
+        
         split = layout.split()
 
         col = split.column()
@@ -214,7 +218,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
         col.itemR(phys, "friction")
         col.itemR(phys, "align_to_normal")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(phys, "force", slider=True)
         col.itemR(phys, "elasticity", slider=True)
@@ -234,6 +238,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -253,7 +258,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel):
         row.active = mat.light_group
         row.itemR(mat, "light_group_exclusive", text="Exclusive")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(mat, "face_texture")
         sub = col.column()
@@ -279,6 +284,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -289,7 +295,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel):
         col.itemR(mat, "cast_shadows_only", text="Cast Only")
         col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(mat, "cast_buffer_shadows")
         sub = col.column()
@@ -314,6 +320,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -323,7 +330,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
         sub.active = (not mat.shadeless)
         sub.itemR(mat, "diffuse_intensity", text="Intensity")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.active = (not mat.shadeless)
         col.itemR(mat, "diffuse_shader", text="")
@@ -341,7 +348,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
             col = split.column()
             col.itemR(mat, "diffuse_toon_size", text="Size")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "diffuse_toon_smooth", text="Smooth")
         elif mat.diffuse_shader == 'FRESNEL':
@@ -350,7 +357,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
             col = split.column()
             col.itemR(mat, "diffuse_fresnel", text="Fresnel")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "diffuse_fresnel_factor", text="Factor")
 
@@ -364,7 +371,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
             col = split.column()
             col.itemR(mat, "diffuse_ramp_input", text="Input")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "diffuse_ramp_blend", text="Blend")
             row = layout.row()
@@ -384,6 +391,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
         layout = self.layout
 
         mat = active_node_mat(context.material)
+        col2 = context.region.width > narrowui
 
         layout.active = (not mat.shadeless)
 
@@ -393,7 +401,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
         col.itemR(mat, "specular_color", text="")
         col.itemR(mat, "specular_intensity", text="Intensity")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(mat, "specular_shader", text="")
         col.itemR(mat, "use_specular_ramp", text="Ramp")
@@ -407,7 +415,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
             col = split.column()
             col.itemR(mat, "specular_hardness", text="Hardness")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "specular_ior", text="IOR")
         elif mat.specular_shader == 'WARDISO':
@@ -418,7 +426,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
             col = split.column()
             col.itemR(mat, "specular_toon_size", text="Size")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "specular_toon_smooth", text="Smooth")
 
@@ -431,7 +439,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
             col = split.column()
             col.itemR(mat, "specular_ramp_input", text="Input")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(mat, "specular_ramp_blend", text="Blend")
             
@@ -461,6 +469,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
 
         mat = active_node_mat(context.material)
         sss = mat.subsurface_scattering
+        col2 = context.region.width > narrowui
 
         layout.active = sss.enabled
 
@@ -473,7 +482,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
         col.itemR(sss, "color", text="")
         col.itemR(sss, "radius", text="RGB Radius")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         sub = col.column(align=True)
         sub.itemL(text="Blend:")
@@ -506,6 +515,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
 
         mat = active_node_mat(context.material)
         raym = mat.raytrace_mirror
+        col2 = context.region.width > narrowui
 
         layout.active = raym.enabled
 
@@ -515,7 +525,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
         col.itemR(raym, "reflect_factor")
         col.itemR(mat, "mirror_color", text="")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(raym, "fresnel")
         sub = col.column()
@@ -533,7 +543,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
         sub.itemL(text="Fade To:")
         sub.itemR(raym, "fade_to", text="")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL(text="Gloss:")
         col.itemR(raym, "gloss_factor", text="Amount")
@@ -564,10 +574,11 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
 
         mat = active_node_mat(context.material)
         rayt = mat.raytrace_transparency
+        col2 = context.region.width > narrowui
 
         row = layout.row()
         row.active = mat.transparency and (not mat.shadeless)
-        if (context.region.width > narrowui):
+        if col2:
             row.itemR(mat, "transparency_method", expand=True)
         else:
             row.itemR(mat, "transparency_method", text="")
@@ -580,7 +591,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
         row.active = mat.transparency and (not mat.shadeless)
         row.itemR(mat, "specular_alpha", text="Specular")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.active = (not mat.shadeless)
         col.itemR(rayt, "fresnel")
@@ -600,7 +611,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
             col.itemR(rayt, "limit")
             col.itemR(rayt, "depth")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemL(text="Gloss:")
             col.itemR(rayt, "gloss_factor", text="Amount")
@@ -624,6 +635,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
 
         mat = context.material # dont use node material
         halo = mat.halo
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -639,7 +651,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
         col.itemR(halo, "shaded")
         col.itemR(halo, "soft")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(halo, "ring")
         sub = col.column()
@@ -678,6 +690,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
 
         mat = context.material # dont use node material
         halo = mat.halo
+        col2 = context.region.width > narrowui
 
         layout.active = halo.flare_mode
 
@@ -687,7 +700,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
         col.itemR(halo, "flare_size", text="Size")
         col.itemR(halo, "flare_boost", text="Boost")
         col.itemR(halo, "flare_seed", text="Seed")
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(halo, "flares_sub", text="Subflares")
         col.itemR(halo, "flare_subsize", text="Subsize")
@@ -728,12 +741,13 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
         layout = self.layout
 
         vol = context.material.volume # dont use node material
+        col2 = context.region.width > narrowui
 
         split = layout.split()
         col = split.column()
         col.itemR(vol, "density")
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(vol, "density_scale")
 
@@ -747,6 +761,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
         layout = self.layout
 
         vol = context.material.volume # dont use node material
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -755,7 +770,7 @@ class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
         col.itemR(vol, "asymmetry")
         col.itemR(vol, "transmission_color")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         sub = col.column(align=True)
         sub.itemR(vol, "emission")
@@ -774,13 +789,14 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
         layout = self.layout
 
         vol = context.material.volume # dont use node material
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
         col = split.column()
         col.itemR(vol, "lighting_mode", text="")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
 
         if vol.lighting_mode == 'SHADED':
@@ -810,8 +826,9 @@ class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
         layout = self.layout
 
         mat = context.material # dont use node material
+        col2 = context.region.width > narrowui
 
-        if (context.region.width > narrowui):
+        if col2:
             layout.itemR(mat, "transparency_method", expand=True)
         else:
             layout.itemR(mat, "transparency_method", text="")
@@ -826,6 +843,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
         layout = self.layout
 
         vol = context.material.volume # dont use node material
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -835,7 +853,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
         col = col.column(align=True)
         col.itemR(vol, "step_size")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL()
         col.itemR(vol, "depth_cutoff")
index a45539e612e534d1ac79c2c54c071cfc5958eada..68bf57e923858a880453557d5908d2ef89a79a42 100644 (file)
@@ -48,8 +48,9 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
         layout = self.layout
 
         ob = context.object
+        col2 = context.region.width > narrowui
 
-        if (context.region.width > narrowui):
+        if col2:
             row = layout.row()
             
             row.column().itemR(ob, "location")
@@ -87,6 +88,7 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel):
         layout = self.layout
 
         ob = context.object
+        col2 = context.region.width > narrowui
 
         row = layout.row()
 
@@ -112,6 +114,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
         layout = self.layout
 
         ob = context.object
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -120,7 +123,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
         col.itemS()
         col.itemR(ob, "pass_index")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL(text="Parent:")
         col.itemR(ob, "parent", text="")
@@ -140,8 +143,9 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
         layout = self.layout
 
         ob = context.object
+        col2 = context.region.width > narrowui
         
-        if (context.region.width > narrowui):
+        if col2:
             split = layout.split()
             split.item_menu_enumO("object.group_add", "group", text="Add to Group")
             split.itemL()
@@ -163,7 +167,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
                 col = split.column()
                 col.itemR(group, "layer", text="Dupli")
                 
-                if (context.region.width > narrowui):
+                if col2:
                     col = split.column()
                 col.itemR(group, "dupli_offset", text="")
 
@@ -175,12 +179,13 @@ class OBJECT_PT_display(ObjectButtonsPanel):
         layout = self.layout
 
         ob = context.object
-
+        col2 = context.region.width > narrowui
+        
         split = layout.split()
         col = split.column()
         col.itemR(ob, "max_draw_type", text="Type")
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         row = col.row()
         row.itemR(ob, "draw_bounds", text="Bounds")
@@ -195,7 +200,7 @@ class OBJECT_PT_display(ObjectButtonsPanel):
         col.itemR(ob, "draw_axis", text="Axis")
         col.itemR(ob, "draw_wire", text="Wire")
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(ob, "draw_texture_space", text="Texture Space")
         col.itemR(ob, "x_ray", text="X-Ray")
@@ -209,8 +214,9 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
         layout = self.layout
 
         ob = context.object
+        col2 = context.region.width > narrowui
         
-        if (context.region.width > narrowui):
+        if col2:
             layout.itemR(ob, "dupli_type", expand=True)
         else:
             layout.itemR(ob, "dupli_type", text="")
@@ -222,7 +228,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
             col.itemR(ob, "dupli_frames_start", text="Start")
             col.itemR(ob, "dupli_frames_end", text="End")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column(align=True)
             col.itemR(ob, "dupli_frames_on", text="On")
             col.itemR(ob, "dupli_frames_off", text="Off")
@@ -238,12 +244,12 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
             col = split.column()
             col.itemR(ob, "dupli_faces_scale", text="Scale")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
 
         elif ob.dupli_type == 'GROUP':
-            if (context.region.width > narrowui):
+            if col2:
                 layout.itemR(ob, "dupli_group", text="Group")
             else:
                 layout.itemR(ob, "dupli_group", text="")
@@ -256,7 +262,8 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
         layout = self.layout
 
         ob = context.object
-
+        col2 = context.region.width > narrowui
+        
         split = layout.split()
 
         col = split.column()
@@ -273,7 +280,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
         row.active = ob.parent != None
         col.itemR(ob, "time_offset", text="Offset")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL(text="Track:")
         col.itemR(ob, "track", text="")
index 51a3a359b5fa0ede5fa2e8dd952efe1691053ae6..51b381478d787610f72175e209bb22984f57e9a1 100644 (file)
@@ -43,14 +43,14 @@ class RENDER_PT_render(RenderButtonsPanel):
         layout = self.layout
 
         rd = context.scene.render_data
-        global narrowui
+        col2 = context.region.width > narrowui
         
         split = layout.split()
         
         col = split.column()
         col.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
 
@@ -67,7 +67,8 @@ class RENDER_PT_layers(RenderButtonsPanel):
 
         scene = context.scene
         rd = scene.render_data
-
+        col2 = context.region.width > narrowui
+        
         row = layout.row()
         row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
 
@@ -84,7 +85,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
 
         col = split.column()
         col.itemR(scene, "visible_layers", text="Scene")
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(rl, "visible_layers", text="Layer")
 
@@ -132,7 +133,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
         col.itemR(rl, "pass_mist")
         col.itemR(rl, "pass_object_index")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL()
         col.itemR(rl, "pass_color")
@@ -162,7 +163,8 @@ class RENDER_PT_shading(RenderButtonsPanel):
         layout = self.layout
 
         rd = context.scene.render_data
-
+        col2 = context.region.width > narrowui
+        
         split = layout.split()
 
         col = split.column()
@@ -171,7 +173,7 @@ class RENDER_PT_shading(RenderButtonsPanel):
         col.itemR(rd, "render_sss", text="Subsurface Scattering")
         col.itemR(rd, "render_envmaps", text="Environment Map")
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(rd, "render_raytracing", text="Ray Tracing")
         col.itemR(rd, "color_management")
@@ -187,7 +189,8 @@ class RENDER_PT_performance(RenderButtonsPanel):
         layout = self.layout
 
         rd = context.scene.render_data
-
+        col2 = context.region.width > narrowui
+        
         split = layout.split()
 
         col = split.column(align=True)
@@ -200,7 +203,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
         col.itemR(rd, "parts_x", text="X")
         col.itemR(rd, "parts_y", text="Y")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemL(text="Memory:")
         sub = col.column()
@@ -229,6 +232,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
         layout = self.layout
         
         rd = context.scene.render_data
+        col2 = context.region.width > narrowui
         
         split = layout.split()
 
@@ -236,7 +240,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
         col.itemR(rd, "use_compositing")
         col.itemR(rd, "use_sequencer")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(rd, "dither_intensity", text="Dither", slider=True)
 
@@ -252,7 +256,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
         sub.itemR(rd, "fields_still", text="Still")
 
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         else:
             col.itemS()
@@ -271,7 +275,7 @@ class RENDER_PT_output(RenderButtonsPanel):
         layout = self.layout
         
         rd = context.scene.render_data
-
+        col2 = context.region.width > narrowui
         
         layout.itemR(rd, "output_path", text="")
 
@@ -280,7 +284,7 @@ class RENDER_PT_output(RenderButtonsPanel):
         col.itemR(rd, "file_format", text="")
         col.row().itemR(rd, "color_mode", text="Color", expand=True)
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(rd, "file_extensions")
         col.itemR(rd, "use_overwrite")
@@ -297,13 +301,13 @@ class RENDER_PT_output(RenderButtonsPanel):
             col.itemL(text="Codec:")
             col.itemR(rd, "exr_codec", text="")
             
-            if (context.region.width > narrowui):
+            if col2:
                 subsplit = split.split()
                 col = subsplit.column()
             col.itemR(rd, "exr_half")
             col.itemR(rd, "exr_zbuf")
             
-            if (context.region.width > narrowui):
+            if col2:
                 col = subsplit.column()
             col.itemR(rd, "exr_preview")
 
@@ -313,7 +317,7 @@ class RENDER_PT_output(RenderButtonsPanel):
             col.itemL(text="Depth:")
             col.row().itemR(rd, "jpeg2k_depth", expand=True)
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
             col.itemR(rd, "jpeg2k_preset", text="")
             col.itemR(rd, "jpeg2k_ycc")
@@ -323,7 +327,7 @@ class RENDER_PT_output(RenderButtonsPanel):
             col = split.column()
             col.itemR(rd, "cineon_log", text="Convert to Log")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column(align=True)
             col.active = rd.cineon_log
             col.itemR(rd, "cineon_black", text="Black")
@@ -348,6 +352,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
         layout = self.layout
 
         rd = context.scene.render_data
+        col2 = context.region.width > narrowui
 
         split = layout.split()
 
@@ -366,7 +371,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
         col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
         col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(rd, "ffmpeg_gopsize")
         col.itemR(rd, "ffmpeg_autosplit")
@@ -385,7 +390,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
         col.itemR(rd, "ffmpeg_audio_bitrate")
         col.itemR(rd, "ffmpeg_audio_mixrate")
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(rd, "ffmpeg_multiplex_audio")
         col.itemR(rd, "ffmpeg_audio_volume")
@@ -404,6 +409,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
         layout = self.layout
 
         rd = context.scene.render_data
+        col2 = context.region.width > narrowui
         layout.active = rd.antialiasing
         
         split = layout.split()
@@ -412,7 +418,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
         col.row().itemR(rd, "antialiasing_samples", expand=True)
         col.itemR(rd, "full_sample")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(rd, "pixel_filter", text="")
         col.itemR(rd, "filter_size", text="Size", slider=True)
@@ -427,6 +433,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
 
         scene = context.scene
         rd = scene.render_data
+        col2 = context.region.width > narrowui
         
         split = layout.split()
 
@@ -447,7 +454,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
         rowsub.active = rd.use_border
         rowsub.itemR(rd, "crop_to_border", text="Crop")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         sub = col.column(align=True)
         sub.itemL(text="Frame Range:")
@@ -475,6 +482,7 @@ class RENDER_PT_stamp(RenderButtonsPanel):
         layout = self.layout
 
         rd = context.scene.render_data
+        col2 = context.region.width > narrowui
 
         layout.active = rd.render_stamp
 
@@ -491,7 +499,7 @@ class RENDER_PT_stamp(RenderButtonsPanel):
         col.itemR(rd, "stamp_marker", text="Marker")
         col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.active = rd.render_stamp
         col.itemR(rd, "stamp_foreground", slider=True)
index 3f8889afbcfbeac4bd68a1fe9b482836e9d98894..170c561820dbd6b7babf4968bf32e5e84fc58bad 100644 (file)
@@ -39,7 +39,7 @@ class SCENE_PT_scene(SceneButtonsPanel):
 
         scene = context.scene
         
-        if (context.region.width > narrowui):
+        if col2:
             layout.itemR(scene, "camera")
             layout.itemR(scene, "set", text="Background")
         else:
@@ -53,7 +53,7 @@ class SCENE_PT_unit(SceneButtonsPanel):
 
     def draw(self, context):
         layout = self.layout
-
+        col2 = context.region.width > narrowui
         unit = context.scene.unit_settings
 
         col = layout.column()
@@ -65,7 +65,7 @@ class SCENE_PT_unit(SceneButtonsPanel):
         col = split.column()
         col.itemR(unit, "scale_length", text="Scale")
         
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(unit, "use_separate")
 
@@ -77,7 +77,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
         layout = self.layout
 
         scene = context.scene
-
+        col2 = context.region.width > narrowui
         row = layout.row()
 
         col = row.column()
@@ -95,7 +95,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
             col.itemR(ks, "name")
             col.itemR(ks, "absolute")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = row.column()
             col.itemL(text="Keyframing Settings:")
             col.itemR(ks, "insertkey_needed", text="Needed")
@@ -113,6 +113,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel):
 
         scene = context.scene
         ks = scene.active_keying_set
+        col2 = context.region.width > narrowui
 
         row = layout.row()
         row.itemL(text="Paths:")
@@ -142,7 +143,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel):
             if ksp.entire_array == False:
                 col.itemR(ksp, "array_index")
 
-            if (context.region.width > narrowui):
+            if col2:
                 col = row.column()
             col.itemL(text="F-Curve Grouping:")
             col.itemR(ksp, "grouping")
@@ -161,10 +162,11 @@ class SCENE_PT_physics(SceneButtonsPanel):
         layout = self.layout
 
         scene = context.scene
-
+        col2 = context.region.width > narrowui
+        
         layout.active = scene.use_gravity
         
-        if (context.region.width > narrowui):
+        if col2:
             layout.itemR(scene, "gravity", text="")
         else:
             layout.column().itemR(scene, "gravity", text="")
index 61190f3cb609e26c5f93de8999a51cdf089c5278..f08cff38dfc3f706dbfd1d7e75e09fb704f690ec 100644 (file)
@@ -70,10 +70,10 @@ class WORLD_PT_world(WorldButtonsPanel):
 
     def draw(self, context):
         layout = self.layout
-
+        col2 = context.region.width > narrowui
         world = context.world
         
-        if (context.region.width > narrowui):
+        if col2:
             row = layout.row()
             row.itemR(world, "paper_sky")
             row.itemR(world, "blend_sky")
@@ -103,7 +103,7 @@ class WORLD_PT_mist(WorldButtonsPanel):
 
     def draw(self, context):
         layout = self.layout
-
+        col2 = context.region.width > narrowui
         world = context.world
 
         layout.active = world.mist.enabled
@@ -114,7 +114,7 @@ class WORLD_PT_mist(WorldButtonsPanel):
         col.itemR(world.mist, "intensity", slider=True)
         col.itemR(world.mist, "start")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(world.mist, "depth")
         col.itemR(world.mist, "height")
@@ -133,7 +133,7 @@ class WORLD_PT_stars(WorldButtonsPanel):
 
     def draw(self, context):
         layout = self.layout
-
+        col2 = context.region.width > narrowui
         world = context.world
 
         layout.active = world.stars.enabled
@@ -144,7 +144,7 @@ class WORLD_PT_stars(WorldButtonsPanel):
         col.itemR(world.stars, "size")
         col.itemR(world.stars, "color_randomization", text="Colors")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(world.stars, "min_distance", text="Min. Dist")
         col.itemR(world.stars, "average_separation", text="Separation")
@@ -161,7 +161,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
 
     def draw(self, context):
         layout = self.layout
-
+        col2 = context.region.width > narrowui
         ao = context.world.ambient_occlusion
 
         layout.active = ao.enabled
@@ -180,7 +180,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
         sub.itemR(ao, "falloff_strength", text="Strength")
 
         if ao.gather_method == 'RAYTRACE':
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
 
             col.itemL(text="Sampling:")
@@ -196,7 +196,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
                 sub.itemR(ao, "bias")
 
         if ao.gather_method == 'APPROXIMATE':
-            if (context.region.width > narrowui):
+            if col2:
                 col = split.column()
 
             col.itemL(text="Sampling:")
@@ -215,7 +215,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
         col = split.column()
         col.itemR(ao, "energy")
 
-        if (context.region.width > narrowui):
+        if col2:
             col = split.column()
         col.itemR(ao, "color")