mirror of
https://github.com/markqvist/Sideband.git
synced 2024-10-01 03:15:37 -04:00
Retain bindings for theme switching
This commit is contained in:
parent
4b619f385d
commit
540a533900
@ -1667,23 +1667,23 @@ class ThemableBehavior(EventDispatcher):
|
|||||||
self.theme_cls = App.get_running_app().theme_cls
|
self.theme_cls = App.get_running_app().theme_cls
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
def dec_disabled(self, *args, **kwargs) -> None:
|
# def dec_disabled(self, *args, **kwargs) -> None:
|
||||||
callabacks = self.theme_cls.get_property_observers("theme_style")
|
# callabacks = self.theme_cls.get_property_observers("theme_style")
|
||||||
|
|
||||||
for callaback in callabacks:
|
# for callaback in callabacks:
|
||||||
try:
|
# try:
|
||||||
if hasattr(callaback, "proxy") and hasattr(
|
# if hasattr(callaback, "proxy") and hasattr(
|
||||||
callaback.proxy, "theme_cls"
|
# callaback.proxy, "theme_cls"
|
||||||
):
|
# ):
|
||||||
for property_name in self.unbind_properties:
|
# for property_name in self.unbind_properties:
|
||||||
self.theme_cls.unbind(
|
# self.theme_cls.unbind(
|
||||||
**{
|
# **{
|
||||||
property_name: getattr(
|
# property_name: getattr(
|
||||||
callaback.proxy, callaback.method_name
|
# callaback.proxy, callaback.method_name
|
||||||
)
|
# )
|
||||||
}
|
# }
|
||||||
)
|
# )
|
||||||
except ReferenceError:
|
# except ReferenceError:
|
||||||
pass
|
# pass
|
||||||
|
|
||||||
super().dec_disabled(*args, **kwargs)
|
# super().dec_disabled(*args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user