Skip to content

Commit

Permalink
Changed to updated Pack.layout() signature (without node)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfWhitt committed Dec 30, 2024
1 parent 5249538 commit f2a4bd6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/travertino/node.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from inspect import signature


class Node:
def __init__(self, style, applicator=None, children=None):
# Parent needs to be primed before style is (potentially) applied with
Expand Down Expand Up @@ -169,7 +172,16 @@ def refresh(self, viewport):
if self._root:
self._root.refresh(viewport)
else:
self.style.layout(self, viewport)
######################################################################
# 2024-12: Backwards compatibility for Toga <= 0.4.8
######################################################################
if "node" in signature(self.style.layout).parameters:
self.style.layout(self, viewport)
else:
self.style.layout(viewport)
######################################################################
# End backwards compatibility
######################################################################
if self.applicator:
self.applicator.set_bounds()

Expand Down

0 comments on commit f2a4bd6

Please sign in to comment.