Skip to content

Commit

Permalink
Work around Travertino _ALL_PROPERTIES version differences
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Jan 20, 2025
1 parent 3ca6a13 commit f6c8041
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion core/src/toga/style/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ def style_mixin(style_cls):
write ``widget.color``.
"""
}
for name in style_cls._ALL_PROPERTIES[style_cls]:

try:
_all_properties = style_cls._BASE_ALL_PROPERTIES
except AttributeError:
# Travertino 0.3 compatibility
_all_properties = style_cls._ALL_PROPERTIES

for name in _all_properties[style_cls]:
mixin_dict[name] = StyleProperty()

return type(style_cls.__name__ + "Mixin", (), mixin_dict)
8 changes: 7 additions & 1 deletion core/src/toga/style/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,4 +1001,10 @@ def __css__(self) -> str:
# FONT_CHOICES
# ])

Pack._ALL_PROPERTIES[Pack].update(Pack._ALIASES)
try:
_all_properties = Pack._BASE_ALL_PROPERTIES
except AttributeError:
# Travertino 0.3 compatibility
_all_properties = Pack._ALL_PROPERTIES

_all_properties[Pack].update(Pack._ALIASES)

0 comments on commit f6c8041

Please sign in to comment.