Skip to content
Snippets Groups Projects
Commit 483cdf6e authored by Philipp Oeser's avatar Philipp Oeser
Browse files

Fix T82453: Icon Viewer: No button on console header

Caused by rB4b20eebb85cc.

Apparently the Addon misused the API though and it is not allowed to
register multiple headers, instead, we need to append to the existing
one.

Maniphest Tasks: T82453

Differential Revision: https://developer.blender.org/D9579
parent b757daf6
No related branches found
No related tags found
No related merge requests found
...@@ -296,17 +296,6 @@ class IV_PT_icons(bpy.types.Panel): ...@@ -296,17 +296,6 @@ class IV_PT_icons(bpy.types.Panel):
return prefs().show_panel return prefs().show_panel
class IV_HT_icons(bpy.types.Header):
bl_space_type = 'CONSOLE'
def draw(self, context):
if not prefs().show_header:
return
layout = self.layout
layout.separator()
layout.operator(IV_OT_icons_show.bl_idname)
class IV_OT_panel_menu_call(bpy.types.Operator): class IV_OT_panel_menu_call(bpy.types.Operator):
bl_idname = "iv.panel_menu_call" bl_idname = "iv.panel_menu_call"
bl_label = "" bl_label = ""
...@@ -487,10 +476,13 @@ class IV_OT_icons_show(bpy.types.Operator): ...@@ -487,10 +476,13 @@ class IV_OT_icons_show(bpy.types.Operator):
return context.window_manager.invoke_props_dialog( return context.window_manager.invoke_props_dialog(
self, width=self.width) self, width=self.width)
def draw_console_header(self, context):
if not prefs().show_header:
return
self.layout.operator(IV_OT_icons_show.bl_idname)
classes = ( classes = (
IV_PT_icons, IV_PT_icons,
IV_HT_icons,
IV_OT_panel_menu_call, IV_OT_panel_menu_call,
IV_OT_icon_select, IV_OT_icon_select,
IV_OT_icons_show, IV_OT_icons_show,
...@@ -505,10 +497,14 @@ def register(): ...@@ -505,10 +497,14 @@ def register():
for cls in classes: for cls in classes:
bpy.utils.register_class(cls) bpy.utils.register_class(cls)
bpy.types.CONSOLE_HT_header.append(draw_console_header)
def unregister(): def unregister():
if bpy.app.background: if bpy.app.background:
return return
bpy.types.CONSOLE_HT_header.remove(draw_console_header)
for cls in classes: for cls in classes:
bpy.utils.unregister_class(cls) bpy.utils.unregister_class(cls)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment