From 04f726aef25b8f4135ed87354a68bed658a01970 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 24 Jan 2023 03:42:34 +0100 Subject: [PATCH] kvui: always display all tab headers (#1399) --- data/client.kv | 2 +- kvui.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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()