Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-27 11:38:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-27 11:42:11 +0400
commita71f072f9ccaae043069df1cbf95c169a60e494e (patch)
tree6e24b45d6dbeff8f6a3774373aeb0171a37fd55a /release/scripts/startup/bl_ui/space_info.py
parent8f2eec5a15b5f26bfbe73382677add202adc89a9 (diff)
UI: Replace +/- menus with collapsible ones
Patch D160, by Scott Petrovic with own modifications.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_info.py')
-rw-r--r--release/scripts/startup/bl_ui/space_info.py35
1 files changed, 25 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 6457075c9e2..769cc53d953 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -34,15 +34,7 @@ class INFO_HT_header(Header):
row = layout.row(align=True)
row.template_header()
- if context.area.show_menus:
- sub = row.row(align=True)
- sub.menu("INFO_MT_file")
- if rd.use_game_engine:
- sub.menu("INFO_MT_game")
- else:
- sub.menu("INFO_MT_render")
- sub.menu("INFO_MT_window")
- sub.menu("INFO_MT_help")
+ INFO_MT_editor_menus.draw_collapsible(context, layout)
if window.screen.show_fullscreen:
layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
@@ -79,6 +71,29 @@ class INFO_HT_header(Header):
row.label(text=scene.statistics(), translate=False)
+class INFO_MT_editor_menus(Menu):
+ bl_idname = "INFO_MT_editor_menus"
+ bl_label = ""
+
+ def draw(self, context):
+ self.draw_menus(self.layout, context)
+
+ @staticmethod
+ def draw_menus(layout, context):
+ scene = context.scene
+ rd = scene.render
+
+ layout.menu("INFO_MT_file")
+
+ if rd.use_game_engine:
+ layout.menu("INFO_MT_game")
+ else:
+ layout.menu("INFO_MT_render")
+
+ layout.menu("INFO_MT_window")
+ layout.menu("INFO_MT_help")
+
+
class INFO_MT_file(Menu):
bl_label = "File"
@@ -132,7 +147,7 @@ class INFO_MT_file(Menu):
layout.operator_context = 'EXEC_AREA'
if bpy.data.is_dirty and context.user_preferences.view.use_quit_dialog:
- layout.operator_context = 'INVOKE_SCREEN' # quit dialog
+ layout.operator_context = 'INVOKE_SCREEN' # quit dialog
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')