svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[blender.git] / release / ui / space_buttons.py
1
2 import bpy
3
4 class Buttons_HT_header(bpy.types.Header):
5         __space_type__ = "BUTTONS_WINDOW"
6         __idname__ = "BUTTONS_HT_header"
7
8         def draw(self, context):
9                 layout = self.layout
10                 
11                 so = context.space_data
12                 scene = context.scene
13
14                 layout.template_header()
15
16                 if context.area.show_menus:
17                         row = layout.row(align=True)
18                         row.itemM("Buttons_MT_view", text="View")
19                         
20                 row = layout.row()
21                 row.itemR(so, "buttons_context", expand=True, text="")
22                 row.itemR(scene, "current_frame")
23
24 class Buttons_MT_view(bpy.types.Menu):
25         __space_type__ = "BUTTONS_WINDOW"
26         __label__ = "View"
27
28         def draw(self, context):
29                 layout = self.layout
30                 so = context.space_data
31
32                 col = layout.column()
33                 col.itemR(so, "panel_alignment", expand=True)
34
35 bpy.types.register(Buttons_HT_header)
36 bpy.types.register(Buttons_MT_view)