From efecbc754824b9831503fd2a978b430240751130 Mon Sep 17 00:00:00 2001 From: Ahter Sonmez Date: Sun, 23 Jul 2023 15:54:47 +0100 Subject: [PATCH] Set flex only when using the default width 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. --- core/src/toga/style/pack.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/toga/style/pack.py b/core/src/toga/style/pack.py index 6208d1f604..7e9650eb25 100644 --- a/core/src/toga/style/pack.py +++ b/core/src/toga/style/pack.py @@ -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