From 540a533900e9420b3eb8fd3d8c70fd3bc9dc3899 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 8 Oct 2022 17:19:20 +0200 Subject: [PATCH] Retain bindings for theme switching --- sbapp/kivymd/theming.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sbapp/kivymd/theming.py b/sbapp/kivymd/theming.py index b0fa0da..7bc4116 100755 --- a/sbapp/kivymd/theming.py +++ b/sbapp/kivymd/theming.py @@ -1667,23 +1667,23 @@ class ThemableBehavior(EventDispatcher): self.theme_cls = App.get_running_app().theme_cls super().__init__(**kwargs) - def dec_disabled(self, *args, **kwargs) -> None: - callabacks = self.theme_cls.get_property_observers("theme_style") + # def dec_disabled(self, *args, **kwargs) -> None: + # callabacks = self.theme_cls.get_property_observers("theme_style") - for callaback in callabacks: - try: - if hasattr(callaback, "proxy") and hasattr( - callaback.proxy, "theme_cls" - ): - for property_name in self.unbind_properties: - self.theme_cls.unbind( - **{ - property_name: getattr( - callaback.proxy, callaback.method_name - ) - } - ) - except ReferenceError: - pass + # for callaback in callabacks: + # try: + # if hasattr(callaback, "proxy") and hasattr( + # callaback.proxy, "theme_cls" + # ): + # for property_name in self.unbind_properties: + # self.theme_cls.unbind( + # **{ + # property_name: getattr( + # callaback.proxy, callaback.method_name + # ) + # } + # ) + # except ReferenceError: + # pass - super().dec_disabled(*args, **kwargs) + # super().dec_disabled(*args, **kwargs)