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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2020-11-16 19:02:44 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-11-26 20:12:23 +0300
commit483cdf6e916279dedb674dfdffd4cac360dc0a62 (patch)
tree0d2e8d36c52a509aada47b49dd495f016d80bc72 /development_icon_get.py
parentb757daf681b0c39c67b3ed2391ff8437a46e237e (diff)
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
Diffstat (limited to 'development_icon_get.py')
-rw-r--r--development_icon_get.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/development_icon_get.py b/development_icon_get.py
index 6e2154ae..e8901eca 100644
--- a/development_icon_get.py
+++ b/development_icon_get.py
@@ -296,17 +296,6 @@ class IV_PT_icons(bpy.types.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):
bl_idname = "iv.panel_menu_call"
bl_label = ""
@@ -487,10 +476,13 @@ class IV_OT_icons_show(bpy.types.Operator):
return context.window_manager.invoke_props_dialog(
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 = (
IV_PT_icons,
- IV_HT_icons,
IV_OT_panel_menu_call,
IV_OT_icon_select,
IV_OT_icons_show,
@@ -505,10 +497,14 @@ def register():
for cls in classes:
bpy.utils.register_class(cls)
+ bpy.types.CONSOLE_HT_header.append(draw_console_header)
+
def unregister():
if bpy.app.background:
return
+ bpy.types.CONSOLE_HT_header.remove(draw_console_header)
+
for cls in classes:
bpy.utils.unregister_class(cls)