a500862e93d0710499effcc94c91cc7cf37c1003
[blender-staging.git] / release / scripts / ui / space_buttons.py
1 # This software is distributable under the terms of the GNU
2 # General Public License (GPL) v2, the text of which can be found at
3 # http://www.gnu.org/copyleft/gpl.html. Installing, importing or otherwise
4 # using this module constitutes acceptance of the terms of this License.
5
6
7 import bpy
8
9 class Buttons_HT_header(bpy.types.Header):
10     bl_space_type = 'PROPERTIES'
11
12     def draw(self, context):
13         layout = self.layout
14
15         so = context.space_data
16         scene = context.scene
17
18         row= layout.row(align=True)
19         row.template_header()
20
21         if context.area.show_menus:
22             sub = row.row(align=True)
23             sub.itemM("Buttons_MT_view", text="View")
24
25         row = layout.row()
26         row.itemR(so, "buttons_context", expand=True, text="")
27         row.itemR(scene, "current_frame")
28
29 class Buttons_MT_view(bpy.types.Menu):
30     bl_label = "View"
31
32     def draw(self, context):
33         layout = self.layout
34         so = context.space_data
35
36         col = layout.column()
37         col.itemR(so, "panel_alignment", expand=True)
38
39 bpy.types.register(Buttons_HT_header)
40 bpy.types.register(Buttons_MT_view)