blender/release/ui/space_buttons.py
Brecht Van Lommel 184ac26dd0 2.5: Headers
* Fix header menu spacing bug, and make it consistent for all headers.
* For consistency, always put menus first in the header, then any enums
  to switch the type of data displayed.
* Node editor header ported to python layout. Still quite a few
  operators missing to make the menus complete.
* RNA wrapped node editor, and added use_nodes property to material
  and scene.
2009-08-19 00:55:30 +00:00

37 lines
783 B
Python

import bpy
class Buttons_HT_header(bpy.types.Header):
__space_type__ = "PROPERTIES"
def draw(self, context):
layout = self.layout
so = context.space_data
scene = context.scene
row= layout.row(align=True)
row.template_header()
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("Buttons_MT_view", text="View")
row = layout.row()
row.itemR(so, "buttons_context", expand=True, text="")
row.itemR(scene, "current_frame")
class Buttons_MT_view(bpy.types.Menu):
__space_type__ = "PROPERTIES"
__label__ = "View"
def draw(self, context):
layout = self.layout
so = context.space_data
col = layout.column()
col.itemR(so, "panel_alignment", expand=True)
bpy.types.register(Buttons_HT_header)
bpy.types.register(Buttons_MT_view)