Fix is_extended method for UI classes (menu, panel, headers... etc)

Appending then removing a draw function caused the is_extended()
method to return true afterwards, resolve by checking if there are
multiple draw functions.
This commit is contained in:
Campbell Barton
2024-02-01 17:03:42 +11:00
parent a8e73616b9
commit dd641d15d0

View File

@@ -1044,7 +1044,12 @@ class _GenericUI:
@classmethod
def is_extended(cls):
return bool(getattr(cls.draw, "_draw_funcs", None))
draw_funcs = getattr(cls.draw, "_draw_funcs", None)
if draw_funcs is None:
return False
# Ignore the first item (the original draw function).
# This can happen when enabling then disabling add-ons.
return len(draw_funcs) > 1
@classmethod
def append(cls, draw_func):