Merging trunk up to r39447.
[blender-staging.git] / release / scripts / startup / bl_ui / space_dopesheet.py
index 646a085f3f7aa9fe521b350f790fce9795043a3e..cab58a3aadb8b9444f43a7eb3a51b17eb8fbf9ee 100644 (file)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 
 import bpy
+from bpy.types import Header, Menu
 
 
 #######################################
@@ -93,7 +94,7 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
 #######################################
 # DopeSheet Editor - General/Standard UI
 
-class DOPESHEET_HT_header(bpy.types.Header):
+class DOPESHEET_HT_header(Header):
     bl_space_type = 'DOPESHEET_EDITOR'
 
     def draw(self, context):
@@ -105,21 +106,19 @@ class DOPESHEET_HT_header(bpy.types.Header):
         row.template_header()
 
         if context.area.show_menus:
-            sub = row.row(align=True)
-
-            sub.menu("DOPESHEET_MT_view")
-            sub.menu("DOPESHEET_MT_select")
-            sub.menu("DOPESHEET_MT_marker")
+            row.menu("DOPESHEET_MT_view")
+            row.menu("DOPESHEET_MT_select")
+            row.menu("DOPESHEET_MT_marker")
 
             if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action != None):
-                sub.menu("DOPESHEET_MT_channel")
+                row.menu("DOPESHEET_MT_channel")
             elif st.mode == 'GPENCIL':
-                sub.menu("DOPESHEET_MT_gpencil_channel")
+                row.menu("DOPESHEET_MT_gpencil_channel")
 
             if st.mode != 'GPENCIL':
-                sub.menu("DOPESHEET_MT_key")
+                row.menu("DOPESHEET_MT_key")
             else:
-                sub.menu("DOPESHEET_MT_gpencil_frame")
+                row.menu("DOPESHEET_MT_gpencil_frame")
 
         layout.prop(st, "mode", text="")
         layout.prop(st.dopesheet, "show_summary", text="Summary")
@@ -143,7 +142,7 @@ class DOPESHEET_HT_header(bpy.types.Header):
         row.operator("action.paste", text="", icon='PASTEDOWN')
 
 
-class DOPESHEET_MT_view(bpy.types.Menu):
+class DOPESHEET_MT_view(Menu):
     bl_label = "View"
 
     def draw(self, context):
@@ -151,8 +150,6 @@ class DOPESHEET_MT_view(bpy.types.Menu):
 
         st = context.space_data
 
-        layout.column()
-
         layout.prop(st, "use_realtime_update")
         layout.prop(st, "show_frame_indicator")
         layout.prop(st, "show_sliders")
@@ -179,13 +176,12 @@ class DOPESHEET_MT_view(bpy.types.Menu):
         layout.operator("screen.screen_full_area")
 
 
-class DOPESHEET_MT_select(bpy.types.Menu):
+class DOPESHEET_MT_select(Menu):
     bl_label = "Select"
 
     def draw(self, context):
         layout = self.layout
 
-        layout.column()
         # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
         layout.operator("action.select_all_toggle")
         layout.operator("action.select_all_toggle", text="Invert Selection").invert = True
@@ -215,7 +211,7 @@ class DOPESHEET_MT_select(bpy.types.Menu):
             layout.operator("action.select_linked")
 
 
-class DOPESHEET_MT_marker(bpy.types.Menu):
+class DOPESHEET_MT_marker(Menu):
     bl_label = "Marker"
 
     def draw(self, context):
@@ -225,7 +221,6 @@ class DOPESHEET_MT_marker(bpy.types.Menu):
 
         #layout.operator_context = 'EXEC_REGION_WIN'
 
-        layout.column()
         layout.operator("marker.add", "Add Marker")
         layout.operator("marker.duplicate", text="Duplicate Marker")
         layout.operator("marker.delete", text="Delete Marker")
@@ -246,7 +241,7 @@ class DOPESHEET_MT_marker(bpy.types.Menu):
 #######################################
 # Keyframe Editing
 
-class DOPESHEET_MT_channel(bpy.types.Menu):
+class DOPESHEET_MT_channel(Menu):
     bl_label = "Channel"
 
     def draw(self, context):
@@ -254,7 +249,6 @@ class DOPESHEET_MT_channel(bpy.types.Menu):
 
         layout.operator_context = 'INVOKE_REGION_CHANNELS'
 
-        layout.column()
         layout.operator("anim.channels_delete")
 
         layout.separator()
@@ -277,13 +271,12 @@ class DOPESHEET_MT_channel(bpy.types.Menu):
         layout.operator("anim.channels_fcurves_enable")
 
 
-class DOPESHEET_MT_key(bpy.types.Menu):
+class DOPESHEET_MT_key(Menu):
     bl_label = "Key"
 
     def draw(self, context):
         layout = self.layout
 
-        layout.column()
         layout.menu("DOPESHEET_MT_key_transform", text="Transform")
 
         layout.operator_menu_enum("action.snap", "type", text="Snap")
@@ -310,13 +303,12 @@ class DOPESHEET_MT_key(bpy.types.Menu):
         layout.operator("action.paste")
 
 
-class DOPESHEET_MT_key_transform(bpy.types.Menu):
+class DOPESHEET_MT_key_transform(Menu):
     bl_label = "Transform"
 
     def draw(self, context):
         layout = self.layout
 
-        layout.column()
         layout.operator("transform.transform", text="Grab/Move").mode = 'TIME_TRANSLATE'
         layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
         layout.operator("transform.transform", text="Slide").mode = 'TIME_SLIDE'
@@ -326,7 +318,7 @@ class DOPESHEET_MT_key_transform(bpy.types.Menu):
 #######################################
 # Grease Pencil Editing
 
-class DOPESHEET_MT_gpencil_channel(bpy.types.Menu):
+class DOPESHEET_MT_gpencil_channel(Menu):
     bl_label = "Channel"
 
     def draw(self, context):
@@ -334,7 +326,6 @@ class DOPESHEET_MT_gpencil_channel(bpy.types.Menu):
 
         layout.operator_context = 'INVOKE_REGION_CHANNELS'
 
-        layout.column()
         layout.operator("anim.channels_delete")
 
         layout.separator()
@@ -354,13 +345,12 @@ class DOPESHEET_MT_gpencil_channel(bpy.types.Menu):
         #layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
 
 
-class DOPESHEET_MT_gpencil_frame(bpy.types.Menu):
+class DOPESHEET_MT_gpencil_frame(Menu):
     bl_label = "Frame"
 
     def draw(self, context):
         layout = self.layout
 
-        layout.column()
         layout.menu("DOPESHEET_MT_key_transform", text="Transform")
 
         #layout.operator_menu_enum("action.snap", "type", text="Snap")