diff --git a/data/client.kv b/data/client.kv index 0b33cda0..5948a3eb 100644 --- a/data/client.kv +++ b/data/client.kv @@ -1,5 +1,5 @@ - tab_width: 200 + tab_width: root.width / app.tab_count : canvas.before: Color: diff --git a/kvui.py b/kvui.py index 9b5d0c23..2fa2d455 100644 --- a/kvui.py +++ b/kvui.py @@ -330,6 +330,12 @@ class GameManager(App): super(GameManager, self).__init__() + @property + def tab_count(self): + if hasattr(self, "tabs"): + return max(1, len(self.tabs.tab_list)) + return 1 + def build(self) -> Layout: self.container = ContainerLayout()