remove narrow ui feature

- re-arranged UI in a way that gave far too much vert scrolling.
- was added all over for simple things like making text="", layout engine should handle this.
- Ton and Brecht are ok with removing this now. Ton would like to work on the layout engine to make it better support these cases.
This commit is contained in:
Campbell Barton
2010-08-06 15:17:44 +00:00
parent 17bd603cbc
commit acca04bf33
33 changed files with 652 additions and 1516 deletions

View File

@@ -19,8 +19,6 @@
# <pep8 compliant>
import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicsButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -44,12 +42,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
ob = context.active_object
game = ob.game
soft = ob.game.soft_body
wide_ui = context.region.width > narrowui
if wide_ui:
layout.prop(game, "physics_type")
else:
layout.prop(game, "physics_type", text="")
layout.prop(game, "physics_type")
layout.separator()
#if game.physics_type == 'DYNAMIC':
@@ -61,8 +55,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
col.prop(game, "ghost")
col.prop(ob, "hide_render", text="Invisible") # out of place but useful
if wide_ui:
col = split.column()
col = split.column()
col.prop(game, "material_physics")
col.prop(game, "rotate_from_normal")
col.prop(game, "no_sleeping")
@@ -77,8 +70,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
col.prop(game, "radius")
col.prop(game, "form_factor")
if wide_ui:
col = split.column()
col = split.column()
sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY')
sub.prop(game, "anisotropic_friction")
@@ -94,8 +86,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
sub.prop(game, "minimum_velocity", text="Minimum")
sub.prop(game, "maximum_velocity", text="Maximum")
if wide_ui:
col = split.column()
col = split.column()
col.label(text="Damping:")
sub = col.column(align=True)
sub.prop(game, "damping", text="Translation", slider=True)
@@ -137,8 +128,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
col.prop(soft, "margin", slider=True)
col.prop(soft, "bending_const", text="Bending Constraints")
if wide_ui:
col = split.column()
col = split.column()
col.prop(soft, "shape_match")
sub = col.column()
sub.active = soft.shape_match
@@ -182,21 +172,16 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, bpy.types.Panel):
layout = self.layout
game = context.active_object.game
wide_ui = context.region.width > narrowui
layout.active = game.use_collision_bounds
if wide_ui:
layout.prop(game, "collision_bounds", text="Bounds")
else:
layout.prop(game, "collision_bounds", text="")
layout.prop(game, "collision_bounds", text="Bounds")
split = layout.split()
col = split.column()
col.prop(game, "collision_margin", text="Margin", slider=True)
if wide_ui:
col = split.column()
col = split.column()
col.prop(game, "collision_compound", text="Compound")
@@ -236,7 +221,6 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout
gs = context.scene.game_data
wide_ui = context.region.width > narrowui
layout.prop(gs, "fullscreen")
@@ -248,8 +232,7 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
sub.prop(gs, "resolution_x", slider=False, text="X")
sub.prop(gs, "resolution_y", slider=False, text="Y")
if wide_ui:
col = split.column()
col = split.column()
col.label(text="Quality:")
sub = col.column(align=True)
sub.prop(gs, "depth", text="Bit Depth", slider=False)
@@ -258,10 +241,7 @@ class RENDER_PT_game_player(RenderButtonsPanel, bpy.types.Panel):
# framing:
col = layout.column()
col.label(text="Framing:")
if wide_ui:
col.row().prop(gs, "framing_type", expand=True)
else:
col.prop(gs, "framing_type", text="")
col.row().prop(gs, "framing_type", expand=True)
if gs.framing_type == 'LETTERBOX':
col.prop(gs, "framing_color", text="")
@@ -280,7 +260,6 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
gs = context.scene.game_data
stereo_mode = gs.stereo
wide_ui = context.region.width > narrowui
# stereo options:
layout.prop(gs, "stereo", expand=True)
@@ -292,10 +271,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
# dome:
elif stereo_mode == 'DOME':
if wide_ui:
layout.prop(gs, "dome_mode", text="Dome Type")
else:
layout.prop(gs, "dome_mode", text="")
layout.prop(gs, "dome_mode", text="Dome Type")
dome_type = gs.dome_mode
@@ -309,8 +285,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
col.prop(gs, "dome_angle", slider=True)
if wide_ui:
col = split.column()
col = split.column()
col.prop(gs, "dome_tesselation", text="Tesselation")
col.prop(gs, "dome_tilt")
@@ -318,15 +293,14 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
if wide_ui:
col = split.column()
col = split.column()
col.prop(gs, "dome_tesselation", text="Tesselation")
else: # cube map
col = split.column()
col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
if wide_ui:
col = split.column()
col = split.column()
layout.prop(gs, "dome_text")
@@ -344,12 +318,8 @@ class RENDER_PT_game_shading(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout
gs = context.scene.game_data
wide_ui = context.region.width > narrowui
if wide_ui:
layout.prop(gs, "material_mode", expand=True)
else:
layout.prop(gs, "material_mode", text="")
layout.prop(gs, "material_mode", expand=True)
if gs.material_mode == 'GLSL':
split = layout.split()
@@ -378,7 +348,6 @@ class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout
gs = context.scene.game_data
wide_ui = context.region.width > narrowui
split = layout.split()
@@ -389,8 +358,8 @@ class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
col.prop(gs, "show_physics_visualization", text="Physics Visualization")
col.prop(gs, "use_deprecation_warnings")
if wide_ui:
col = split.column()
col = split.column()
col.label(text="Render:")
col.prop(gs, "use_frame_rate")
col.prop(gs, "use_display_lists")
@@ -409,12 +378,9 @@ class RENDER_PT_game_sound(RenderButtonsPanel, bpy.types.Panel):
layout = self.layout
scene = context.scene
wide_ui = context.region.width > narrowui
if wide_ui:
layout.prop(scene, "distance_model")
else:
layout.prop(scene, "distance_model", text="")
layout.prop(scene, "distance_model")
layout.prop(scene, "speed_of_sound", text="Speed")
layout.prop(scene, "doppler_factor")
@@ -441,19 +407,12 @@ class WORLD_PT_game_context_world(WorldButtonsPanel, bpy.types.Panel):
scene = context.scene
world = context.world
space = context.space_data
wide_ui = context.region.width > narrowui
if wide_ui:
split = layout.split(percentage=0.65)
if scene:
split.template_ID(scene, "world", new="world.new")
elif world:
split.template_ID(space, "pin_id")
else:
if scene:
layout.template_ID(scene, "world", new="world.new")
elif world:
layout.template_ID(space, "pin_id")
split = layout.split(percentage=0.65)
if scene:
split.template_ID(scene, "world", new="world.new")
elif world:
split.template_ID(space, "pin_id")
class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel):
@@ -469,15 +428,13 @@ class WORLD_PT_game_world(WorldButtonsPanel, bpy.types.Panel):
layout = self.layout
world = context.world
wide_ui = context.region.width > narrowui
split = layout.split()
col = split.column()
col.prop(world, "horizon_color")
if wide_ui:
col = split.column()
col = split.column()
col.prop(world, "ambient_color")
@@ -499,7 +456,6 @@ class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel):
layout = self.layout
world = context.world
wide_ui = context.region.width > narrowui
layout.active = world.mist.use_mist
split = layout.split()
@@ -507,8 +463,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(world.mist, "start")
if wide_ui:
col = split.column()
col = split.column()
col.prop(world.mist, "depth")
@@ -525,7 +480,6 @@ class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
layout = self.layout
gs = context.scene.game_data
wide_ui = context.region.width > narrowui
layout.prop(gs, "physics_engine")
if gs.physics_engine != 'NONE':
@@ -540,8 +494,7 @@ class WORLD_PT_game_physics(WorldButtonsPanel, bpy.types.Panel):
sub.prop(gs, "physics_step_sub", text="Substeps")
col.prop(gs, "fps", text="FPS")
if wide_ui:
col = split.column()
col = split.column()
col.label(text="Logic Steps:")
col.prop(gs, "logic_step_max", text="Max")