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:
@@ -19,7 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
################################################
|
||||
# Generic Panels (Independent of DataType)
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
|
||||
class PoseTemplateSettings(bpy.types.IDPropertyGroup):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
|
||||
class DataButtonsPanel(bpy.types.Panel):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
narrowmod = 260
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
|
||||
class PhysicsButtonsPanel(bpy.types.Panel):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# <pep8 compliant>
|
||||
import bpy
|
||||
|
||||
narrowui = 180
|
||||
narrowui = bpy.context.user_preferences.view.properties_width_check
|
||||
|
||||
|
||||
class ConstraintButtonsPanel(bpy.types.Panel):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
# <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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user