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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user