space_info.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # ##### BEGIN GPL LICENSE BLOCK #####
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU General Public License
  5. # as published by the Free Software Foundation; either version 2
  6. # of the License, or (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software Foundation,
  15. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. #
  17. # ##### END GPL LICENSE BLOCK #####
  18. # <pep8 compliant>
  19. from bpy.types import Header, Menu
  20. class INFO_HT_header(Header):
  21. bl_space_type = 'INFO'
  22. def draw(self, _context):
  23. layout = self.layout
  24. layout.template_header()
  25. # Empty for now until info editor gets turned into log editor
  26. # Not really info, just add to re-usable location.
  27. class INFO_MT_area(Menu):
  28. bl_label = "Area"
  29. def draw(self, context):
  30. layout = self.layout
  31. if context.space_data.type == 'VIEW_3D':
  32. layout.operator("screen.region_quadview")
  33. layout.separator()
  34. layout.operator("screen.area_split", text="Horizontal Split").direction = 'HORIZONTAL'
  35. layout.operator("screen.area_split", text="Vertical Split").direction = 'VERTICAL'
  36. layout.separator()
  37. layout.operator("screen.area_dupli", icon='DUPLICATE')
  38. layout.separator()
  39. layout.operator("screen.screen_full_area")
  40. layout.operator(
  41. "screen.screen_full_area",
  42. text="Toggle Fullscreen Area",
  43. icon='FULLSCREEN_ENTER',
  44. ).use_hide_panels = True
  45. classes = (
  46. INFO_HT_header,
  47. INFO_MT_area,
  48. )
  49. if __name__ == "__main__": # only for live edit.
  50. from bpy.utils import register_class
  51. for cls in classes:
  52. register_class(cls)