Properties Window:
authorThomas Dinges <blender@dingto.org>
Sun, 16 May 2010 10:21:00 +0000 (10:21 +0000)
committerThomas Dinges <blender@dingto.org>
Sun, 16 May 2010 10:21:00 +0000 (10:21 +0000)
*The narrowui value was hard coded in all ui scripts, made an user preferences option. Basically this value determines on which area width, it should switch between dual/single column layout.

ToDo: The Changes only take effect when reloading scripts/restarting Blender (after saving as default). Will maybe add the "Reload Scripts" operator next to the button in the future.

* Small fix for Fluid Add Button, when in single column mode. Didn't expand like the other "Add" Buttons.

32 files changed:
release/scripts/ui/properties_animviz.py
release/scripts/ui/properties_data_armature.py
release/scripts/ui/properties_data_armature_rigify.py
release/scripts/ui/properties_data_bone.py
release/scripts/ui/properties_data_camera.py
release/scripts/ui/properties_data_curve.py
release/scripts/ui/properties_data_empty.py
release/scripts/ui/properties_data_lamp.py
release/scripts/ui/properties_data_lattice.py
release/scripts/ui/properties_data_mesh.py
release/scripts/ui/properties_data_metaball.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_game.py
release/scripts/ui/properties_material.py
release/scripts/ui/properties_object.py
release/scripts/ui/properties_object_constraint.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_physics_cloth.py
release/scripts/ui/properties_physics_common.py
release/scripts/ui/properties_physics_field.py
release/scripts/ui/properties_physics_fluid.py
release/scripts/ui/properties_physics_smoke.py
release/scripts/ui/properties_physics_softbody.py
release/scripts/ui/properties_render.py
release/scripts/ui/properties_scene.py
release/scripts/ui/properties_texture.py
release/scripts/ui/properties_world.py
release/scripts/ui/space_image.py
release/scripts/ui/space_userpref.py
source/blender/editors/interface/resources.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c

index 311a8b119cfaf516e0aad0785108f469bf0c459b..3e9c2158cb73a040d0a12179740368cc05dea49a 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 ################################################
 # Generic Panels (Independent of DataType)
index 953ab5e5abdbdc13471f3fcc7e56682fd3ecdb66..805a21b3be2b8a0c2fbc1d483499b3b21b23af4b 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class DataButtonsPanel(bpy.types.Panel):
index ba012368def34b76843b73c06da8f99b1ca0eac4..5ec50973ea4a9c88a53bdaa70c900c263743e784 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class PoseTemplateSettings(bpy.types.IDPropertyGroup):
index 982572b62a381fc346501015d729d55cbc02e97d..b6b638ef380bfff6b80ff0ab9ec6a40e4e6e0b6e 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class BoneButtonsPanel(bpy.types.Panel):
index 4ce124a279e782d4fce7b2a5517a94d93648c2b5..3abd460c4277114a6270c11e5e41b08ed51376f2 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class DataButtonsPanel(bpy.types.Panel):
index 62c81df2eceacefa3a0fc8c43770a0d19bc10ad3..5f1dc662b9765cc1b449f233cb36818739509188 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class DataButtonsPanel(bpy.types.Panel):
index a0999fb9d4ab352166d2406f3174805522ca84ed..577e32ed8400f452216687e9fb9f7c56902e86a2 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class DataButtonsPanel(bpy.types.Panel):
index 26f4b158c90193819b602b61d44fdacfe4f8ddd0..4338489ac5a1f4446489011394042fa462054b03 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class LAMP_MT_sunsky_presets(bpy.types.Menu):
index 2a78d329223a1bc8d1bd341e302917d99b7328fb..2aa719437a7dafe18cf01402509a655411f3d69f 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class DataButtonsPanel(bpy.types.Panel):
index 5321c76679c87c9dd3f2ca9f53e16f9ccdec2be6..44d3d19e79318a3284c91f87f654cec8ff58dfbd 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class MESH_MT_vertex_group_specials(bpy.types.Menu):
index b751a9f9059238814873580cbe0824692872c00f..e0155059b98a14ac00f075ac917fa2301cea4de5 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class DataButtonsPanel(bpy.types.Panel):
index 888d20cb5e138ccc7d8f1fe10408730cc135207f..535e5afdd790a1ea73bebe84d5478a1025fec8a8 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 narrowmod = 260
 
 
index 41af955d9ecf9dedf80c1315a07842cbe15163d4..a5b443a461ba7693f89a129f81f001226db4342d 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class PhysicsButtonsPanel(bpy.types.Panel):
index a7d9af9999deed97479789d32b4c5815cbd90403..1526bd004a0b60b3d302024cf033e7bb9c5db276 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 def active_node_mat(mat):
index 211a7f5c2e93fa6c9b2ad5d6faa4c2d1d6017196..6dbfe269436c93ddcb3637c6d12e1b1856ce1ebf 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class ObjectButtonsPanel(bpy.types.Panel):
index a81ab2fb4d20629d7029c7a26a6b5b9e6b24bf8f..f53bac05a7c34642fb3afc27a5296e72e8ad5fe7 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class ConstraintButtonsPanel(bpy.types.Panel):
index a1bc4019c6d89b0a11260234255881a4e7888966..35c1f84cca5ad1b8d79290f8e5fefcd75da9974c 100644 (file)
@@ -25,7 +25,7 @@ from properties_physics_common import effector_weights_ui
 from properties_physics_common import basic_force_field_settings_ui
 from properties_physics_common import basic_force_field_falloff_ui
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 def particle_panel_enabled(context, psys):
index 67fc79eb4d1c56e3c2a8cf88d8162bf5967f7313..834e3cf2450a6c62e3d5f5477776b1cbf05879a5 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 from properties_physics_common import point_cache_ui
@@ -75,7 +75,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
             # add modifier
             split.operator("object.modifier_add", text="Add").type = 'CLOTH'
             if wide_ui:
-                split.column()
+                split.label()
 
         if md:
             cloth = md.settings
index eac2bc60f3533f6b7350482a39dbc4ab819b1ca4..097f7586e58b2309fdf2b988e496a0b353eb45b4 100644 (file)
 
 # <pep8 compliant>
 
-narrowui = 180
-
 import bpy
 
+narrowui = bpy.context.user_preferences.view.properties_width_check
+
 #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
 def point_cache_ui(self, context, cache, enabled, cachetype):
     layout = self.layout
index 4dfe4f6372e200a44ac1e5cd71aa9da2822bdf9b..57fa40e4c5dd25311b5c6c53de1ef4c1e3a4f636 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 from properties_physics_common import basic_force_field_settings_ui
index e3e6e1dbb3d46e6b38e751644da59656677521cf..32acd88654d09cba5e09525edae8bff7daf0d355 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class PhysicButtonsPanel(bpy.types.Panel):
@@ -42,7 +42,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
         md = context.fluid
         wide_ui = context.region.width > narrowui
 
-        split = layout.split(percentage=0.5)
+        split = layout.split()
 
         if md:
             # remove modifier + settings
index d4a40dc678804fd6629d39a10ef716c5403f5491..f362588cd98ba543c3c2c3563250041021209b01 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 from properties_physics_common import point_cache_ui
index 8e685b8a66cdb4be96a1b838a4b7fc0e70a18265..696f29810a35c48884d1555ced5ebf24f56f00dc 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 from properties_physics_common import point_cache_ui
index ae03d4d28d00ff96b9ee6de51fdd01ce03736823..53b17ed67dbef667dfa7f26a74600a4c936754a9 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class RENDER_MT_presets(bpy.types.Menu):
index 119988f8fa332d2a75b48a9582f99f56adad1ebe..48cddb799bcbc40ec92e82207bb45c8abcf46ae7 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class SceneButtonsPanel(bpy.types.Panel):
index 07a097cfd3a404b1672ae4e9b373118ac64f58b7..976c3be667f606e9b5cbc2c40ab8f4b9ddf214ec 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class TEXTURE_MT_specials(bpy.types.Menu):
index 5d4dce88492589b7b3bcae53f9102a29ba1c4697..e63d513a4b51d454b5f426e9f585ec84730d88b7 100644 (file)
@@ -20,7 +20,7 @@
 import bpy
 from rna_prop_ui import PropertyPanel
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class WorldButtonsPanel(bpy.types.Panel):
index be7370302eccd635a294571f3bae4f5ef651cb7a..f0a5a3384be00571f56d2f36cc8860143c6121ff 100644 (file)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 import bpy
 
-narrowui = 180
+narrowui = bpy.context.user_preferences.view.properties_width_check
 
 
 class IMAGE_MT_view(bpy.types.Menu):
index be56cffb59a52b5082eb423a1b42039e36b59586..a850f543e041bdcf3ccb052c8c90e5b5660c4c4a 100644 (file)
@@ -165,6 +165,13 @@ class USERPREF_PT_interface(bpy.types.Panel):
         sub.enabled = view.show_mini_axis
         sub.prop(view, "mini_axis_size", text="Size")
         sub.prop(view, "mini_axis_brightness", text="Brightness")
+        
+        col.separator()
+        col.separator()
+        col.separator()
+        
+        col.label(text="Properties Window:")
+        col.prop(view, "properties_width_check")
 
         row.separator()
         row.separator()
index 49c455d9299f876d17cb0b424b5731aee4bf3656..82b195fb94a69d8690c19217fd437be71b9e3832 100644 (file)
@@ -1488,6 +1488,11 @@ void init_userdef_do_versions(void)
        if (U.v2d_min_gridsize == 0) {
                U.v2d_min_gridsize= 35;
        }
+       
+       /* Single Column UI Value */
+       if (U.propwidth == 0) {
+               U.propwidth = 200;
+       }
 
        /* funny name, but it is GE stuff, moves userdef stuff to engine */
 // XXX space_set_commmandline_options();
index 933ccf1bdd0a92b5136d0b62dc833f1526405c51..091c05a8b983cc0e6e19b165deab57c41d47b7ec 100644 (file)
@@ -362,6 +362,8 @@ typedef struct UserDef {
 
        short scrcastfps;               /* frame rate for screencast to be played back */
        short scrcastwait;              /* milliseconds between screencast snapshots */
+       
+       short propwidth, pad[3]; /* Value for Dual/Single Column UI */
 
        char versemaster[160];
        char verseuser[160];
index aa152fbf2b0233f7c338187fe6ccb27f901030ba..e19efd745d80084dfd3c8fe1a85f980de106295a 100644 (file)
@@ -2052,6 +2052,13 @@ static void rna_def_userdef_view(BlenderRNA *brna)
        RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
        RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
+       
+       /* Properties Window */
+       prop= RNA_def_property(srna, "properties_width_check", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, "propwidth");
+       RNA_def_property_range(prop, 150, 400); 
+       RNA_def_property_ui_text(prop, "Width Check", "Dual Column layout will change to single column layout when the width of the area gets below this value (needs restart to take effect)");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
 }
 
 static void rna_def_userdef_edit(BlenderRNA *brna)