made scripts pass the pep8 test (though not fully pep8 yet)
[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 # <pep8 compliant>
7 import bpy
8
9
10 class Buttons_HT_header(bpy.types.Header):
11     bl_space_type = 'PROPERTIES'
12
13     def draw(self, context):
14         layout = self.layout
15
16         so = context.space_data
17         scene = context.scene
18
19         row = layout.row(align=True)
20         row.template_header()
21
22         if context.area.show_menus:
23             sub = row.row(align=True)
24             sub.itemM("Buttons_MT_view", text="View")
25
26         row = layout.row()
27         row.itemR(so, "buttons_context", expand=True, text="")
28         row.itemR(scene, "current_frame")
29
30
31 class Buttons_MT_view(bpy.types.Menu):
32     bl_label = "View"
33
34     def draw(self, context):
35         layout = self.layout
36         so = context.space_data
37
38         col = layout.column()
39         col.itemR(so, "panel_alignment", expand=True)
40
41 bpy.types.register(Buttons_HT_header)
42 bpy.types.register(Buttons_MT_view)