Skip to content

Commit

Permalink
Set flex only when using the default width
Browse files Browse the repository at this point in the history
This was necessary to override the behavior of adding
flex element to the style. The spinner (activity indicator)
needs to have this set to false.
  • Loading branch information
ahter committed Jul 23, 2023
1 parent 4b05cfe commit 8a82297
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/toga/style/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,10 @@ def __css__(self):
# direction
css.append(f"flex-direction: {self.direction.lower()};")
# flex
if (self.width == NONE and self.direction == ROW) or (
self.height == NONE and self.direction == COLUMN
):
if (
(self.width == NONE and self.direction == ROW)
or (self.height == NONE and self.direction == COLUMN)
) and getattr(self, "_use_default_width", True):
css.append(f"flex: {self.flex} 0 0;")

# width/flex
Expand Down

0 comments on commit 8a82297

Please sign in to comment.