Properties Window:

*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.
This commit is contained in:
2010-05-16 10:21:00 +00:00
parent c2ffcb8497
commit e1bf9d30bc
32 changed files with 52 additions and 31 deletions

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
################################################ ################################################
# Generic Panels (Independent of DataType) # Generic Panels (Independent of DataType)

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class PoseTemplateSettings(bpy.types.IDPropertyGroup): class PoseTemplateSettings(bpy.types.IDPropertyGroup):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class BoneButtonsPanel(bpy.types.Panel): class BoneButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel 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): class LAMP_MT_sunsky_presets(bpy.types.Menu):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel 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): class MESH_MT_vertex_group_specials(bpy.types.Menu):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
narrowmod = 260 narrowmod = 260

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicsButtonsPanel(bpy.types.Panel): class PhysicsButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
def active_node_mat(mat): def active_node_mat(mat):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class ObjectButtonsPanel(bpy.types.Panel): class ObjectButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class ConstraintButtonsPanel(bpy.types.Panel): class ConstraintButtonsPanel(bpy.types.Panel):

View 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_settings_ui
from properties_physics_common import basic_force_field_falloff_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): def particle_panel_enabled(context, psys):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui
@@ -75,7 +75,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
# add modifier # add modifier
split.operator("object.modifier_add", text="Add").type = 'CLOTH' split.operator("object.modifier_add", text="Add").type = 'CLOTH'
if wide_ui: if wide_ui:
split.column() split.label()
if md: if md:
cloth = md.settings cloth = md.settings

View File

@@ -18,10 +18,10 @@
# <pep8 compliant> # <pep8 compliant>
narrowui = 180
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
def point_cache_ui(self, context, cache, enabled, cachetype): def point_cache_ui(self, context, cache, enabled, cachetype):
layout = self.layout layout = self.layout

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import basic_force_field_settings_ui from properties_physics_common import basic_force_field_settings_ui

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicButtonsPanel(bpy.types.Panel): class PhysicButtonsPanel(bpy.types.Panel):
@@ -42,7 +42,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
md = context.fluid md = context.fluid
wide_ui = context.region.width > narrowui wide_ui = context.region.width > narrowui
split = layout.split(percentage=0.5) split = layout.split()
if md: if md:
# remove modifier + settings # remove modifier + settings

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class RENDER_MT_presets(bpy.types.Menu): class RENDER_MT_presets(bpy.types.Menu):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class SceneButtonsPanel(bpy.types.Panel): class SceneButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class TEXTURE_MT_specials(bpy.types.Menu): class TEXTURE_MT_specials(bpy.types.Menu):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class WorldButtonsPanel(bpy.types.Panel): class WorldButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class IMAGE_MT_view(bpy.types.Menu): class IMAGE_MT_view(bpy.types.Menu):

View File

@@ -165,6 +165,13 @@ class USERPREF_PT_interface(bpy.types.Panel):
sub.enabled = view.show_mini_axis sub.enabled = view.show_mini_axis
sub.prop(view, "mini_axis_size", text="Size") sub.prop(view, "mini_axis_size", text="Size")
sub.prop(view, "mini_axis_brightness", text="Brightness") 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()
row.separator() row.separator()

View File

@@ -1488,6 +1488,11 @@ void init_userdef_do_versions(void)
if (U.v2d_min_gridsize == 0) { if (U.v2d_min_gridsize == 0) {
U.v2d_min_gridsize= 35; 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 */ /* funny name, but it is GE stuff, moves userdef stuff to engine */
// XXX space_set_commmandline_options(); // XXX space_set_commmandline_options();

View File

@@ -362,6 +362,8 @@ typedef struct UserDef {
short scrcastfps; /* frame rate for screencast to be played back */ short scrcastfps; /* frame rate for screencast to be played back */
short scrcastwait; /* milliseconds between screencast snapshots */ short scrcastwait; /* milliseconds between screencast snapshots */
short propwidth, pad[3]; /* Value for Dual/Single Column UI */
char versemaster[160]; char versemaster[160];
char verseuser[160]; char verseuser[160];

View 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_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_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"); 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) static void rna_def_userdef_edit(BlenderRNA *brna)