UI: Replace +/- menus with collapsible ones
Patch D160, by Scott Petrovic with own modifications.
This commit is contained in:
@@ -86290,6 +86290,42 @@
|
|||||||
id="path18197"
|
id="path18197"
|
||||||
style="opacity:0.7;fill:url(#linearGradient18212);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98985863;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
style="opacity:0.7;fill:url(#linearGradient18212);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.98985863;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
|
||||||
sodipodi:type="arc" />
|
sodipodi:type="arc" />
|
||||||
|
<g
|
||||||
|
style="display:inline;enable-background:new"
|
||||||
|
id="g24559-2-1"
|
||||||
|
transform="translate(279.8665,506.92392)">
|
||||||
|
<rect
|
||||||
|
y="111"
|
||||||
|
x="103"
|
||||||
|
height="16"
|
||||||
|
width="16"
|
||||||
|
id="rect24489-7-4"
|
||||||
|
style="opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
|
||||||
|
<rect
|
||||||
|
style="fill:#ececec;fill-opacity:1;stroke:#141414;stroke-width:0.79452544;stroke-opacity:1"
|
||||||
|
id="rect29842"
|
||||||
|
width="11.816368"
|
||||||
|
height="2.1883197"
|
||||||
|
x="105.18671"
|
||||||
|
y="-116.88043"
|
||||||
|
transform="scale(1,-1)" />
|
||||||
|
<rect
|
||||||
|
style="fill:#ececec;fill-opacity:1;stroke:#141414;stroke-width:0.79452544;stroke-opacity:1;display:inline;enable-background:new"
|
||||||
|
id="rect29842-4"
|
||||||
|
width="11.816368"
|
||||||
|
height="2.1883197"
|
||||||
|
x="105.31538"
|
||||||
|
y="-120.80865"
|
||||||
|
transform="scale(1,-1)" />
|
||||||
|
<rect
|
||||||
|
style="fill:#ececec;fill-opacity:1;stroke:#141414;stroke-width:0.79452544;stroke-opacity:1;display:inline;enable-background:new"
|
||||||
|
id="rect29842-4-5"
|
||||||
|
width="11.816368"
|
||||||
|
height="2.1883197"
|
||||||
|
x="105.41832"
|
||||||
|
y="-124.71391"
|
||||||
|
transform="scale(1,-1)" />
|
||||||
|
</g>
|
||||||
<g
|
<g
|
||||||
inkscape:export-ydpi="90"
|
inkscape:export-ydpi="90"
|
||||||
inkscape:export-xdpi="90"
|
inkscape:export-xdpi="90"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.2 MiB After Width: | Height: | Size: 4.2 MiB |
BIN
release/datafiles/blender_icons16/icon16_collapsemenu.dat
Normal file
BIN
release/datafiles/blender_icons16/icon16_collapsemenu.dat
Normal file
Binary file not shown.
BIN
release/datafiles/blender_icons32/icon32_collapsemenu.dat
Normal file
BIN
release/datafiles/blender_icons32/icon32_collapsemenu.dat
Normal file
Binary file not shown.
@@ -753,6 +753,17 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
|
|||||||
self.preset_operator,
|
self.preset_operator,
|
||||||
filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
|
filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def draw_collapsible(cls, context, layout):
|
||||||
|
# helper function for (optionally) collapsed header menus
|
||||||
|
# only usable within headers
|
||||||
|
if context.area.show_menus:
|
||||||
|
cls.draw_menus(layout, context)
|
||||||
|
else:
|
||||||
|
layout.separator()
|
||||||
|
layout.menu(cls.__name__, icon='COLLAPSEMENU')
|
||||||
|
layout.separator()
|
||||||
|
|
||||||
|
|
||||||
class Region(StructRNA):
|
class Region(StructRNA):
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|||||||
@@ -51,18 +51,7 @@ class CLIP_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
CLIP_MT_tracking_editor_menus.draw_collapsible(context, layout)
|
||||||
sub = row.row(align=True)
|
|
||||||
sub.menu("CLIP_MT_view")
|
|
||||||
|
|
||||||
if sc.view == 'CLIP':
|
|
||||||
if clip:
|
|
||||||
sub.menu("CLIP_MT_select")
|
|
||||||
sub.menu("CLIP_MT_clip")
|
|
||||||
sub.menu("CLIP_MT_track")
|
|
||||||
sub.menu("CLIP_MT_reconstruction")
|
|
||||||
else:
|
|
||||||
sub.menu("CLIP_MT_clip")
|
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_ID(sc, "clip", open="clip.open")
|
row.template_ID(sc, "clip", open="clip.open")
|
||||||
@@ -128,16 +117,7 @@ class CLIP_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
CLIP_MT_masking_editor_menus.draw_collapsible(context, layout)
|
||||||
sub = row.row(align=True)
|
|
||||||
sub.menu("CLIP_MT_view")
|
|
||||||
|
|
||||||
if clip:
|
|
||||||
sub.menu("MASK_MT_select")
|
|
||||||
sub.menu("CLIP_MT_clip") # XXX - remove?
|
|
||||||
sub.menu("MASK_MT_mask")
|
|
||||||
else:
|
|
||||||
sub.menu("CLIP_MT_clip") # XXX - remove?
|
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_ID(sc, "clip", open="clip.open")
|
row.template_ID(sc, "clip", open="clip.open")
|
||||||
@@ -169,6 +149,52 @@ class CLIP_HT_header(Header):
|
|||||||
layout.template_running_jobs()
|
layout.template_running_jobs()
|
||||||
|
|
||||||
|
|
||||||
|
class CLIP_MT_tracking_editor_menus(Menu):
|
||||||
|
bl_idname = "CLIP_MT_tracking_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
sc = context.space_data
|
||||||
|
clip = sc.clip
|
||||||
|
|
||||||
|
layout.menu("CLIP_MT_view")
|
||||||
|
|
||||||
|
if sc.view == 'CLIP':
|
||||||
|
if clip:
|
||||||
|
layout.menu("CLIP_MT_select")
|
||||||
|
layout.menu("CLIP_MT_clip")
|
||||||
|
layout.menu("CLIP_MT_track")
|
||||||
|
layout.menu("CLIP_MT_reconstruction")
|
||||||
|
else:
|
||||||
|
layout.menu("CLIP_MT_clip")
|
||||||
|
|
||||||
|
|
||||||
|
class CLIP_MT_masking_editor_menus(Menu):
|
||||||
|
|
||||||
|
bl_idname = "CLIP_MT_masking_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
layout.menu("CLIP_MT_view")
|
||||||
|
|
||||||
|
if clip:
|
||||||
|
layout.menu("MASK_MT_select")
|
||||||
|
layout.menu("CLIP_MT_clip") # XXX - remove?
|
||||||
|
layout.menu("MASK_MT_mask")
|
||||||
|
else:
|
||||||
|
layout.menu("CLIP_MT_clip") # XXX - remove?
|
||||||
|
|
||||||
|
|
||||||
class CLIP_PT_clip_view_panel:
|
class CLIP_PT_clip_view_panel:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -29,12 +29,23 @@ class CONSOLE_HT_header(Header):
|
|||||||
|
|
||||||
layout.template_header()
|
layout.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
CONSOLE_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
layout.menu("CONSOLE_MT_console")
|
|
||||||
|
|
||||||
layout.operator("console.autocomplete", text="Autocomplete")
|
layout.operator("console.autocomplete", text="Autocomplete")
|
||||||
|
|
||||||
|
|
||||||
|
class CONSOLE_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "CONSOLE_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
layout.menu("CONSOLE_MT_console")
|
||||||
|
|
||||||
|
|
||||||
class CONSOLE_MT_console(Menu):
|
class CONSOLE_MT_console(Menu):
|
||||||
bl_label = "Console"
|
bl_label = "Console"
|
||||||
|
|
||||||
|
|||||||
@@ -107,20 +107,7 @@ class DOPESHEET_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
DOPESHEET_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row.menu("DOPESHEET_MT_view")
|
|
||||||
row.menu("DOPESHEET_MT_select")
|
|
||||||
row.menu("DOPESHEET_MT_marker")
|
|
||||||
|
|
||||||
if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None):
|
|
||||||
row.menu("DOPESHEET_MT_channel")
|
|
||||||
elif st.mode == 'GPENCIL':
|
|
||||||
row.menu("DOPESHEET_MT_gpencil_channel")
|
|
||||||
|
|
||||||
if st.mode != 'GPENCIL':
|
|
||||||
row.menu("DOPESHEET_MT_key")
|
|
||||||
else:
|
|
||||||
row.menu("DOPESHEET_MT_gpencil_frame")
|
|
||||||
|
|
||||||
layout.prop(st, "mode", text="")
|
layout.prop(st, "mode", text="")
|
||||||
layout.prop(st.dopesheet, "show_summary", text="Summary")
|
layout.prop(st.dopesheet, "show_summary", text="Summary")
|
||||||
@@ -144,6 +131,32 @@ class DOPESHEET_HT_header(Header):
|
|||||||
row.operator("action.paste", text="", icon='PASTEDOWN')
|
row.operator("action.paste", text="", icon='PASTEDOWN')
|
||||||
|
|
||||||
|
|
||||||
|
class DOPESHEET_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "DOPESHEET_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
st = context.space_data
|
||||||
|
|
||||||
|
layout.menu("DOPESHEET_MT_view")
|
||||||
|
layout.menu("DOPESHEET_MT_select")
|
||||||
|
layout.menu("DOPESHEET_MT_marker")
|
||||||
|
|
||||||
|
if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None):
|
||||||
|
layout.menu("DOPESHEET_MT_channel")
|
||||||
|
elif st.mode == 'GPENCIL':
|
||||||
|
layout.menu("DOPESHEET_MT_gpencil_channel")
|
||||||
|
|
||||||
|
if st.mode != 'GPENCIL':
|
||||||
|
layout.menu("DOPESHEET_MT_key")
|
||||||
|
else:
|
||||||
|
layout.menu("DOPESHEET_MT_gpencil_frame")
|
||||||
|
|
||||||
|
|
||||||
class DOPESHEET_MT_view(Menu):
|
class DOPESHEET_MT_view(Menu):
|
||||||
bl_label = "View"
|
bl_label = "View"
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class FILEBROWSER_HT_header(Header):
|
|||||||
|
|
||||||
st = context.space_data
|
st = context.space_data
|
||||||
|
|
||||||
layout.template_header(menus=False)
|
layout.template_header()
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.separator()
|
row.separator()
|
||||||
|
|||||||
@@ -35,12 +35,7 @@ class GRAPH_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
GRAPH_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row.menu("GRAPH_MT_view")
|
|
||||||
row.menu("GRAPH_MT_select")
|
|
||||||
row.menu("GRAPH_MT_marker")
|
|
||||||
row.menu("GRAPH_MT_channel")
|
|
||||||
row.menu("GRAPH_MT_key")
|
|
||||||
|
|
||||||
layout.prop(st, "mode", text="")
|
layout.prop(st, "mode", text="")
|
||||||
|
|
||||||
@@ -65,6 +60,22 @@ class GRAPH_HT_header(Header):
|
|||||||
row.operator("graph.ghost_curves_create", text="", icon='GHOST_ENABLED')
|
row.operator("graph.ghost_curves_create", text="", icon='GHOST_ENABLED')
|
||||||
|
|
||||||
|
|
||||||
|
class GRAPH_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "GRAPH_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
layout.menu("GRAPH_MT_view")
|
||||||
|
layout.menu("GRAPH_MT_select")
|
||||||
|
layout.menu("GRAPH_MT_marker")
|
||||||
|
layout.menu("GRAPH_MT_channel")
|
||||||
|
layout.menu("GRAPH_MT_key")
|
||||||
|
|
||||||
|
|
||||||
class GRAPH_MT_view(Menu):
|
class GRAPH_MT_view(Menu):
|
||||||
bl_label = "View"
|
bl_label = "View"
|
||||||
|
|
||||||
|
|||||||
@@ -373,25 +373,7 @@ class IMAGE_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
# menus
|
MASK_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
if context.area.show_menus:
|
|
||||||
sub = row.row(align=True)
|
|
||||||
sub.menu("IMAGE_MT_view")
|
|
||||||
|
|
||||||
if show_uvedit:
|
|
||||||
sub.menu("IMAGE_MT_select")
|
|
||||||
if show_maskedit:
|
|
||||||
sub.menu("MASK_MT_select")
|
|
||||||
|
|
||||||
if ima and ima.is_dirty:
|
|
||||||
sub.menu("IMAGE_MT_image", text="Image*")
|
|
||||||
else:
|
|
||||||
sub.menu("IMAGE_MT_image", text="Image")
|
|
||||||
|
|
||||||
if show_uvedit:
|
|
||||||
sub.menu("IMAGE_MT_uvs")
|
|
||||||
if show_maskedit:
|
|
||||||
sub.menu("MASK_MT_mask")
|
|
||||||
|
|
||||||
layout.template_ID(sima, "image", new="image.new", open="image.open")
|
layout.template_ID(sima, "image", new="image.new", open="image.open")
|
||||||
if not show_render:
|
if not show_render:
|
||||||
@@ -450,6 +432,40 @@ class IMAGE_HT_header(Header):
|
|||||||
layout.prop(sima, "use_realtime_update", text="", icon_only=True, icon='LOCKED')
|
layout.prop(sima, "use_realtime_update", text="", icon_only=True, icon='LOCKED')
|
||||||
|
|
||||||
|
|
||||||
|
class MASK_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "MASK_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
sima = context.space_data
|
||||||
|
ima = sima.image
|
||||||
|
|
||||||
|
show_render = sima.show_render
|
||||||
|
show_uvedit = sima.show_uvedit
|
||||||
|
show_maskedit = sima.show_maskedit
|
||||||
|
|
||||||
|
layout.menu("IMAGE_MT_view")
|
||||||
|
|
||||||
|
if show_uvedit:
|
||||||
|
layout.menu("IMAGE_MT_select")
|
||||||
|
if show_maskedit:
|
||||||
|
layout.menu("MASK_MT_select")
|
||||||
|
|
||||||
|
if ima and ima.is_dirty:
|
||||||
|
layout.menu("IMAGE_MT_image", text="Image*")
|
||||||
|
else:
|
||||||
|
layout.menu("IMAGE_MT_image", text="Image")
|
||||||
|
|
||||||
|
if show_uvedit:
|
||||||
|
layout.menu("IMAGE_MT_uvs")
|
||||||
|
if show_maskedit:
|
||||||
|
layout.menu("MASK_MT_mask")
|
||||||
|
|
||||||
|
|
||||||
class IMAGE_PT_image_properties(Panel):
|
class IMAGE_PT_image_properties(Panel):
|
||||||
bl_space_type = 'IMAGE_EDITOR'
|
bl_space_type = 'IMAGE_EDITOR'
|
||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
|
|||||||
@@ -34,15 +34,7 @@ class INFO_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
INFO_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
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")
|
|
||||||
|
|
||||||
if window.screen.show_fullscreen:
|
if window.screen.show_fullscreen:
|
||||||
layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
|
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)
|
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):
|
class INFO_MT_file(Menu):
|
||||||
bl_label = "File"
|
bl_label = "File"
|
||||||
|
|
||||||
@@ -132,7 +147,7 @@ class INFO_MT_file(Menu):
|
|||||||
|
|
||||||
layout.operator_context = 'EXEC_AREA'
|
layout.operator_context = 'EXEC_AREA'
|
||||||
if bpy.data.is_dirty and context.user_preferences.view.use_quit_dialog:
|
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')
|
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,10 +93,20 @@ class LOGIC_HT_header(Header):
|
|||||||
|
|
||||||
layout.template_header()
|
layout.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
LOGIC_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row = layout.row(align=True)
|
|
||||||
row.menu("LOGIC_MT_view")
|
|
||||||
row.menu("LOGIC_MT_logicbricks_add")
|
class LOGIC_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "LOGIC_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
layout.menu("LOGIC_MT_view")
|
||||||
|
layout.menu("LOGIC_MT_logicbricks_add")
|
||||||
|
|
||||||
|
|
||||||
class LOGIC_MT_view(Menu):
|
class LOGIC_MT_view(Menu):
|
||||||
|
|||||||
@@ -35,18 +35,29 @@ class NLA_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
NLA_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row.menu("NLA_MT_view")
|
|
||||||
row.menu("NLA_MT_select")
|
|
||||||
row.menu("NLA_MT_marker")
|
|
||||||
row.menu("NLA_MT_edit")
|
|
||||||
row.menu("NLA_MT_add")
|
|
||||||
|
|
||||||
dopesheet_filter(layout, context)
|
dopesheet_filter(layout, context)
|
||||||
|
|
||||||
layout.prop(st, "auto_snap", text="")
|
layout.prop(st, "auto_snap", text="")
|
||||||
|
|
||||||
|
|
||||||
|
class NLA_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "NLA_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
layout.menu("NLA_MT_view")
|
||||||
|
layout.menu("NLA_MT_select")
|
||||||
|
layout.menu("NLA_MT_marker")
|
||||||
|
layout.menu("NLA_MT_edit")
|
||||||
|
layout.menu("NLA_MT_add")
|
||||||
|
|
||||||
|
|
||||||
class NLA_MT_view(Menu):
|
class NLA_MT_view(Menu):
|
||||||
bl_label = "View"
|
bl_label = "View"
|
||||||
|
|
||||||
|
|||||||
@@ -36,11 +36,7 @@ class NODE_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
NODE_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row.menu("NODE_MT_view")
|
|
||||||
row.menu("NODE_MT_select")
|
|
||||||
row.menu("NODE_MT_add")
|
|
||||||
row.menu("NODE_MT_node")
|
|
||||||
|
|
||||||
layout.prop(snode, "tree_type", text="", expand=True)
|
layout.prop(snode, "tree_type", text="", expand=True)
|
||||||
|
|
||||||
@@ -115,6 +111,21 @@ class NODE_HT_header(Header):
|
|||||||
layout.template_running_jobs()
|
layout.template_running_jobs()
|
||||||
|
|
||||||
|
|
||||||
|
class NODE_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "NODE_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
layout.menu("NODE_MT_view")
|
||||||
|
layout.menu("NODE_MT_select")
|
||||||
|
layout.menu("NODE_MT_add")
|
||||||
|
layout.menu("NODE_MT_node")
|
||||||
|
|
||||||
|
|
||||||
class NODE_MT_add(bpy.types.Menu):
|
class NODE_MT_add(bpy.types.Menu):
|
||||||
bl_space_type = 'NODE_EDITOR'
|
bl_space_type = 'NODE_EDITOR'
|
||||||
bl_label = "Add"
|
bl_label = "Add"
|
||||||
|
|||||||
@@ -34,12 +34,7 @@ class OUTLINER_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
OUTLINER_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
sub = row.row(align=True)
|
|
||||||
sub.menu("OUTLINER_MT_view")
|
|
||||||
sub.menu("OUTLINER_MT_search")
|
|
||||||
if space.display_mode == 'DATABLOCKS':
|
|
||||||
sub.menu("OUTLINER_MT_edit_datablocks")
|
|
||||||
|
|
||||||
layout.prop(space, "display_mode", text="")
|
layout.prop(space, "display_mode", text="")
|
||||||
|
|
||||||
@@ -64,6 +59,24 @@ class OUTLINER_HT_header(Header):
|
|||||||
row.label(text="No Keying Set active")
|
row.label(text="No Keying Set active")
|
||||||
|
|
||||||
|
|
||||||
|
class OUTLINER_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "OUTLINER_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
space = context.space_data
|
||||||
|
|
||||||
|
layout.menu("OUTLINER_MT_view")
|
||||||
|
layout.menu("OUTLINER_MT_search")
|
||||||
|
|
||||||
|
if space.display_mode == 'DATABLOCKS':
|
||||||
|
layout.menu("OUTLINER_MT_edit_datablocks")
|
||||||
|
|
||||||
|
|
||||||
class OUTLINER_MT_view(Menu):
|
class OUTLINER_MT_view(Menu):
|
||||||
bl_label = "View"
|
bl_label = "View"
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class PROPERTIES_HT_header(Header):
|
|||||||
view = context.space_data
|
view = context.space_data
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_header(menus=False)
|
row.template_header()
|
||||||
row.prop(view, "context", expand=True, icon_only=True)
|
row.prop(view, "context", expand=True, icon_only=True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,14 +63,7 @@ class SEQUENCER_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
SEQUENCER_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row.menu("SEQUENCER_MT_view")
|
|
||||||
|
|
||||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
|
||||||
row.menu("SEQUENCER_MT_select")
|
|
||||||
row.menu("SEQUENCER_MT_marker")
|
|
||||||
row.menu("SEQUENCER_MT_add")
|
|
||||||
row.menu("SEQUENCER_MT_strip")
|
|
||||||
|
|
||||||
layout.prop(st, "view_type", expand=True, text="")
|
layout.prop(st, "view_type", expand=True, text="")
|
||||||
|
|
||||||
@@ -112,6 +105,26 @@ class SEQUENCER_HT_header(Header):
|
|||||||
layout.template_running_jobs()
|
layout.template_running_jobs()
|
||||||
|
|
||||||
|
|
||||||
|
class SEQUENCER_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "SEQUENCER_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
st = context.space_data
|
||||||
|
|
||||||
|
layout.menu("SEQUENCER_MT_view")
|
||||||
|
|
||||||
|
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||||
|
layout.menu("SEQUENCER_MT_select")
|
||||||
|
layout.menu("SEQUENCER_MT_marker")
|
||||||
|
layout.menu("SEQUENCER_MT_add")
|
||||||
|
layout.menu("SEQUENCER_MT_strip")
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_MT_view_toggle(Menu):
|
class SEQUENCER_MT_view_toggle(Menu):
|
||||||
bl_label = "View Type"
|
bl_label = "View Type"
|
||||||
|
|
||||||
|
|||||||
@@ -34,21 +34,14 @@ class TEXT_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
TEXT_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row.menu("TEXT_MT_view")
|
|
||||||
row.menu("TEXT_MT_text")
|
|
||||||
|
|
||||||
if text:
|
|
||||||
row.menu("TEXT_MT_edit")
|
|
||||||
row.menu("TEXT_MT_format")
|
|
||||||
|
|
||||||
row.menu("TEXT_MT_templates")
|
|
||||||
|
|
||||||
if text and text.is_modified:
|
if text and text.is_modified:
|
||||||
sub = row.row(align=True)
|
sub = row.row(align=True)
|
||||||
sub.alert = True
|
sub.alert = True
|
||||||
sub.operator("text.resolve_conflict", text="", icon='HELP')
|
sub.operator("text.resolve_conflict", text="", icon='HELP')
|
||||||
|
|
||||||
|
row = layout.row(align=True)
|
||||||
row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open")
|
row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
@@ -84,6 +77,28 @@ class TEXT_HT_header(Header):
|
|||||||
else "Text: Internal")
|
else "Text: Internal")
|
||||||
|
|
||||||
|
|
||||||
|
class TEXT_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "TEXT_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
st = context.space_data
|
||||||
|
text = st.text
|
||||||
|
|
||||||
|
layout.menu("TEXT_MT_view")
|
||||||
|
layout.menu("TEXT_MT_text")
|
||||||
|
|
||||||
|
if text:
|
||||||
|
layout.menu("TEXT_MT_edit")
|
||||||
|
layout.menu("TEXT_MT_format")
|
||||||
|
|
||||||
|
layout.menu("TEXT_MT_templates")
|
||||||
|
|
||||||
|
|
||||||
class TEXT_PT_properties(Panel):
|
class TEXT_PT_properties(Panel):
|
||||||
bl_space_type = 'TEXT_EDITOR'
|
bl_space_type = 'TEXT_EDITOR'
|
||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
|
|||||||
@@ -34,11 +34,7 @@ class TIME_HT_header(Header):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
if context.area.show_menus:
|
TIME_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
row.menu("TIME_MT_view")
|
|
||||||
row.menu("TIME_MT_marker")
|
|
||||||
row.menu("TIME_MT_frame")
|
|
||||||
row.menu("TIME_MT_playback")
|
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(scene, "use_preview_range", text="", toggle=True)
|
row.prop(scene, "use_preview_range", text="", toggle=True)
|
||||||
@@ -96,6 +92,21 @@ class TIME_HT_header(Header):
|
|||||||
row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
|
row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
|
||||||
|
|
||||||
|
|
||||||
|
class TIME_MT_editor_menus(Menu):
|
||||||
|
bl_idname = "TIME_MT_editor_menus"
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
layout.menu("TIME_MT_view")
|
||||||
|
layout.menu("TIME_MT_marker")
|
||||||
|
layout.menu("TIME_MT_frame")
|
||||||
|
layout.menu("TIME_MT_playback")
|
||||||
|
|
||||||
|
|
||||||
class TIME_MT_marker(Menu):
|
class TIME_MT_marker(Menu):
|
||||||
bl_label = "Marker"
|
bl_label = "Marker"
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class USERPREF_HT_header(Header):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
layout.template_header(menus=False)
|
layout.template_header()
|
||||||
|
|
||||||
userpref = context.user_preferences
|
userpref = context.user_preferences
|
||||||
|
|
||||||
@@ -432,12 +432,12 @@ class USERPREF_PT_system(Panel):
|
|||||||
col.label(text="Might fail for Mesh editing selection!")
|
col.label(text="Might fail for Mesh editing selection!")
|
||||||
col.separator()
|
col.separator()
|
||||||
col.prop(system, "use_region_overlap")
|
col.prop(system, "use_region_overlap")
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
col.label(text="Text Draw Options:")
|
col.label(text="Text Draw Options:")
|
||||||
col.prop(system, "use_text_antialiasing")
|
col.prop(system, "use_text_antialiasing")
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
col.label(text="Textures:")
|
col.label(text="Textures:")
|
||||||
@@ -917,7 +917,7 @@ class USERPREF_PT_file(Panel):
|
|||||||
col.prop(paths, "save_version")
|
col.prop(paths, "save_version")
|
||||||
col.prop(paths, "recent_files")
|
col.prop(paths, "recent_files")
|
||||||
col.prop(paths, "use_save_preview_images")
|
col.prop(paths, "use_save_preview_images")
|
||||||
|
|
||||||
col.separator()
|
col.separator()
|
||||||
|
|
||||||
col.label(text="Auto Save:")
|
col.label(text="Auto Save:")
|
||||||
@@ -1047,7 +1047,7 @@ class USERPREF_PT_input(Panel):
|
|||||||
sub.row().prop(inputs, "view_rotate_method", expand=True)
|
sub.row().prop(inputs, "view_rotate_method", expand=True)
|
||||||
|
|
||||||
sub.separator()
|
sub.separator()
|
||||||
|
|
||||||
sub.label(text="Zoom Style:")
|
sub.label(text="Zoom Style:")
|
||||||
sub.row().prop(inputs, "view_zoom_method", text="")
|
sub.row().prop(inputs, "view_zoom_method", text="")
|
||||||
if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}:
|
if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}:
|
||||||
|
|||||||
@@ -37,47 +37,9 @@ class VIEW3D_HT_header(Header):
|
|||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
sub = row.row(align=True)
|
||||||
|
|
||||||
# Menus
|
VIEW3D_MT_editor_menus.draw_collapsible(context, layout)
|
||||||
if context.area.show_menus:
|
|
||||||
sub = row.row(align=True)
|
|
||||||
|
|
||||||
sub.menu("VIEW3D_MT_view")
|
|
||||||
|
|
||||||
# Select Menu
|
|
||||||
if mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
|
|
||||||
mesh = obj.data
|
|
||||||
if mesh.use_paint_mask:
|
|
||||||
sub.menu("VIEW3D_MT_select_paint_mask")
|
|
||||||
elif mesh.use_paint_mask_vertex and mode_string == 'PAINT_WEIGHT':
|
|
||||||
sub.menu("VIEW3D_MT_select_paint_mask_vertex")
|
|
||||||
elif mode_string not in {'SCULPT'}:
|
|
||||||
sub.menu("VIEW3D_MT_select_%s" % mode_string.lower())
|
|
||||||
|
|
||||||
if mode_string == 'OBJECT':
|
|
||||||
sub.menu("INFO_MT_add", text="Add")
|
|
||||||
elif mode_string == 'EDIT_MESH':
|
|
||||||
sub.menu("INFO_MT_mesh_add", text="Add")
|
|
||||||
elif mode_string == 'EDIT_CURVE':
|
|
||||||
sub.menu("INFO_MT_curve_add", text="Add")
|
|
||||||
elif mode_string == 'EDIT_SURFACE':
|
|
||||||
sub.menu("INFO_MT_surface_add", text="Add")
|
|
||||||
elif mode_string == 'EDIT_METABALL':
|
|
||||||
sub.menu("INFO_MT_metaball_add", text="Add")
|
|
||||||
elif mode_string == 'EDIT_ARMATURE':
|
|
||||||
sub.menu("INFO_MT_edit_armature_add", text="Add")
|
|
||||||
|
|
||||||
if edit_object:
|
|
||||||
sub.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
|
|
||||||
elif obj:
|
|
||||||
if mode_string not in {'PAINT_TEXTURE'}:
|
|
||||||
sub.menu("VIEW3D_MT_%s" % mode_string.lower())
|
|
||||||
if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
|
|
||||||
sub.menu("VIEW3D_MT_brush")
|
|
||||||
if mode_string == 'SCULPT':
|
|
||||||
sub.menu("VIEW3D_MT_hide_mask")
|
|
||||||
else:
|
|
||||||
sub.menu("VIEW3D_MT_object")
|
|
||||||
|
|
||||||
# Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
|
# Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
|
||||||
row = layout
|
row = layout
|
||||||
@@ -143,6 +105,57 @@ class VIEW3D_HT_header(Header):
|
|||||||
row.operator("pose.paste", text="", icon='PASTEFLIPDOWN').flipped = 1
|
row.operator("pose.paste", text="", icon='PASTEFLIPDOWN').flipped = 1
|
||||||
|
|
||||||
|
|
||||||
|
class VIEW3D_MT_editor_menus(Menu):
|
||||||
|
bl_space_type = 'VIEW3D_MT_editor_menus'
|
||||||
|
bl_label = ""
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
self.draw_menus(self.layout, context)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def draw_menus(layout, context):
|
||||||
|
obj = context.active_object
|
||||||
|
mode_string = context.mode
|
||||||
|
edit_object = context.edit_object
|
||||||
|
|
||||||
|
layout.menu("VIEW3D_MT_view")
|
||||||
|
|
||||||
|
# Select Menu
|
||||||
|
if mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
|
||||||
|
mesh = obj.data
|
||||||
|
if mesh.use_paint_mask:
|
||||||
|
layout.menu("VIEW3D_MT_select_paint_mask")
|
||||||
|
elif mesh.use_paint_mask_vertex and mode_string == 'PAINT_WEIGHT':
|
||||||
|
layout.menu("VIEW3D_MT_select_paint_mask_vertex")
|
||||||
|
elif mode_string not in {'EDIT_TEXT', 'SCULPT'}:
|
||||||
|
layout.menu("VIEW3D_MT_select_%s" % mode_string.lower())
|
||||||
|
|
||||||
|
if mode_string == 'OBJECT':
|
||||||
|
layout.menu("INFO_MT_add", text="Add")
|
||||||
|
elif mode_string == 'EDIT_MESH':
|
||||||
|
layout.menu("INFO_MT_mesh_add", text="Add")
|
||||||
|
elif mode_string == 'EDIT_CURVE':
|
||||||
|
layout.menu("INFO_MT_curve_add", text="Add")
|
||||||
|
elif mode_string == 'EDIT_SURFACE':
|
||||||
|
layout.menu("INFO_MT_surface_add", text="Add")
|
||||||
|
elif mode_string == 'EDIT_METABALL':
|
||||||
|
layout.menu("INFO_MT_metaball_add", text="Add")
|
||||||
|
elif mode_string == 'EDIT_ARMATURE':
|
||||||
|
layout.menu("INFO_MT_edit_armature_add", text="Add")
|
||||||
|
|
||||||
|
if edit_object:
|
||||||
|
layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
|
||||||
|
elif obj:
|
||||||
|
if mode_string not in {'PAINT_TEXTURE'}:
|
||||||
|
layout.menu("VIEW3D_MT_%s" % mode_string.lower())
|
||||||
|
if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
|
||||||
|
layout.menu("VIEW3D_MT_brush")
|
||||||
|
if mode_string == 'SCULPT':
|
||||||
|
layout.menu("VIEW3D_MT_hide_mask")
|
||||||
|
else:
|
||||||
|
layout.menu("VIEW3D_MT_object")
|
||||||
|
|
||||||
|
|
||||||
# ********** Menu **********
|
# ********** Menu **********
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ void ED_region_visible_rect(struct ARegion *ar, struct rcti *rect);
|
|||||||
/* spaces */
|
/* spaces */
|
||||||
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf);
|
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf);
|
||||||
int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco);
|
int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco);
|
||||||
int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco);
|
|
||||||
|
|
||||||
|
|
||||||
/* areas */
|
/* areas */
|
||||||
|
|||||||
@@ -51,9 +51,7 @@ DEF_ICON(MENU_PANEL)
|
|||||||
DEF_ICON(BLENDER)
|
DEF_ICON(BLENDER)
|
||||||
DEF_ICON(GRIP)
|
DEF_ICON(GRIP)
|
||||||
DEF_ICON(DOT)
|
DEF_ICON(DOT)
|
||||||
#ifndef DEF_ICON_BLANK_SKIP
|
DEF_ICON(COLLAPSEMENU)
|
||||||
DEF_ICON(BLANK004)
|
|
||||||
#endif
|
|
||||||
DEF_ICON(X)
|
DEF_ICON(X)
|
||||||
#ifndef DEF_ICON_BLANK_SKIP
|
#ifndef DEF_ICON_BLANK_SKIP
|
||||||
DEF_ICON(BLANK005)
|
DEF_ICON(BLANK005)
|
||||||
|
|||||||
@@ -820,7 +820,7 @@ uiLayout *uiLayoutOverlap(uiLayout *layout);
|
|||||||
uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
|
uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout);
|
||||||
|
|
||||||
/* templates */
|
/* templates */
|
||||||
void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus);
|
void uiTemplateHeader(uiLayout *layout, struct bContext *C);
|
||||||
void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
|
void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
|
||||||
const char *newop, const char *openop, const char *unlinkop);
|
const char *newop, const char *openop, const char *unlinkop);
|
||||||
void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
|
void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
|
||||||
|
|||||||
@@ -91,13 +91,12 @@ void UI_template_fix_linking(void)
|
|||||||
|
|
||||||
/********************** Header Template *************************/
|
/********************** Header Template *************************/
|
||||||
|
|
||||||
void uiTemplateHeader(uiLayout *layout, bContext *C, int menus)
|
void uiTemplateHeader(uiLayout *layout, bContext *C)
|
||||||
{
|
{
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
|
|
||||||
block = uiLayoutAbsoluteBlock(layout);
|
block = uiLayoutAbsoluteBlock(layout);
|
||||||
if (menus) ED_area_header_standardbuttons(C, block, 0);
|
ED_area_header_switchbutton(C, block, 0);
|
||||||
else ED_area_header_switchbutton(C, block, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************** Search Callbacks *************************/
|
/********************** Search Callbacks *************************/
|
||||||
|
|||||||
@@ -1533,39 +1533,6 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
|
|||||||
return xco + 1.7 * U.widget_unit;
|
return xco + 1.7 * U.widget_unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
|
|
||||||
{
|
|
||||||
ScrArea *sa = CTX_wm_area(C);
|
|
||||||
int xco = 0.4 * U.widget_unit;
|
|
||||||
uiBut *but;
|
|
||||||
|
|
||||||
if (!sa->full)
|
|
||||||
xco = ED_area_header_switchbutton(C, block, yco);
|
|
||||||
|
|
||||||
uiBlockSetEmboss(block, UI_EMBOSSN);
|
|
||||||
|
|
||||||
if (sa->flag & HEADER_NO_PULLDOWN) {
|
|
||||||
but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
|
|
||||||
ICON_DISCLOSURE_TRI_RIGHT,
|
|
||||||
xco, yco, U.widget_unit, U.widget_unit * 0.9f,
|
|
||||||
&(sa->flag), 0, 0, 0, 0,
|
|
||||||
TIP_("Show pulldown menus"));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
|
|
||||||
ICON_DISCLOSURE_TRI_DOWN,
|
|
||||||
xco, yco, U.widget_unit, U.widget_unit * 0.9f,
|
|
||||||
&(sa->flag), 0, 0, 0, 0,
|
|
||||||
TIP_("Hide pulldown menus"));
|
|
||||||
}
|
|
||||||
|
|
||||||
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
|
|
||||||
|
|
||||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
|
||||||
|
|
||||||
return xco + U.widget_unit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************ standard UI regions ************************/
|
/************************ standard UI regions ************************/
|
||||||
|
|
||||||
void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr)
|
void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr)
|
||||||
|
|||||||
@@ -3046,9 +3046,9 @@ static int header_toggle_menus_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
static void SCREEN_OT_header_toggle_menus(wmOperatorType *ot)
|
static void SCREEN_OT_header_toggle_menus(wmOperatorType *ot)
|
||||||
{
|
{
|
||||||
/* identifiers */
|
/* identifiers */
|
||||||
ot->name = "Show/Hide Header Menus";
|
ot->name = "Expand/Collapse Header Menus";
|
||||||
ot->idname = "SCREEN_OT_header_toggle_menus";
|
ot->idname = "SCREEN_OT_header_toggle_menus";
|
||||||
ot->description = "Show or hide the header pulldown menus";
|
ot->description = "Expand or collapse the header pulldown menus";
|
||||||
|
|
||||||
/* api callbacks */
|
/* api callbacks */
|
||||||
ot->exec = header_toggle_menus_exec;
|
ot->exec = header_toggle_menus_exec;
|
||||||
@@ -3069,10 +3069,9 @@ void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *UN
|
|||||||
else
|
else
|
||||||
uiItemO(layout, IFACE_("Flip to Top"), ICON_NONE, "SCREEN_OT_header_flip");
|
uiItemO(layout, IFACE_("Flip to Top"), ICON_NONE, "SCREEN_OT_header_flip");
|
||||||
|
|
||||||
if (sa->flag & HEADER_NO_PULLDOWN)
|
uiItemO(layout, IFACE_("Collapse Menus"),
|
||||||
uiItemO(layout, IFACE_("Show Menus"), ICON_NONE, "SCREEN_OT_header_toggle_menus");
|
(sa->flag & HEADER_NO_PULLDOWN) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT,
|
||||||
else
|
"SCREEN_OT_header_toggle_menus");
|
||||||
uiItemO(layout, IFACE_("Hide Menus"), ICON_NONE, "SCREEN_OT_header_toggle_menus");
|
|
||||||
|
|
||||||
uiItemS(layout);
|
uiItemS(layout);
|
||||||
|
|
||||||
|
|||||||
@@ -631,7 +631,6 @@ void RNA_api_ui_layout(StructRNA *srna)
|
|||||||
/* templates */
|
/* templates */
|
||||||
func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
|
func = RNA_def_function(srna, "template_header", "uiTemplateHeader");
|
||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
RNA_def_boolean(func, "menus", true, "", "The header has menus, and should show menu expander");
|
|
||||||
|
|
||||||
func = RNA_def_function(srna, "template_ID", "uiTemplateID");
|
func = RNA_def_function(srna, "template_ID", "uiTemplateID");
|
||||||
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
|
||||||
|
|||||||
@@ -465,7 +465,7 @@ struct bTheme *UI_GetTheme(void) {STUB_ASSERT(0); return (struct bTheme *) NULL;
|
|||||||
/* rna template */
|
/* rna template */
|
||||||
void uiTemplateAnyID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *text) {STUB_ASSERT(0);}
|
void uiTemplateAnyID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *text) {STUB_ASSERT(0);}
|
||||||
void uiTemplatePathBuilder(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *root_ptr, char *text) {STUB_ASSERT(0);}
|
void uiTemplatePathBuilder(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *root_ptr, char *text) {STUB_ASSERT(0);}
|
||||||
void uiTemplateHeader(struct uiLayout *layout, struct bContext *C, int menus) {STUB_ASSERT(0);}
|
void uiTemplateHeader(struct uiLayout *layout, struct bContext *C) {STUB_ASSERT(0);}
|
||||||
void uiTemplateID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop) {STUB_ASSERT(0);}
|
void uiTemplateID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop) {STUB_ASSERT(0);}
|
||||||
struct uiLayout *uiTemplateModifier(struct uiLayout *layout, struct PointerRNA *ptr) {STUB_ASSERT(0); return (struct uiLayout *) NULL;}
|
struct uiLayout *uiTemplateModifier(struct uiLayout *layout, struct PointerRNA *ptr) {STUB_ASSERT(0); return (struct uiLayout *) NULL;}
|
||||||
struct uiLayout *uiTemplateConstraint(struct uiLayout *layout, struct PointerRNA *ptr) {STUB_ASSERT(0); return (struct uiLayout *) NULL;}
|
struct uiLayout *uiTemplateConstraint(struct uiLayout *layout, struct PointerRNA *ptr) {STUB_ASSERT(0); return (struct uiLayout *) NULL;}
|
||||||
|
|||||||
Reference in New Issue
Block a user