kvui: always display all tab headers (#1399)

This commit is contained in:
Fabian Dill 2023-01-24 03:42:34 +01:00 committed by GitHub
parent 8a4298e504
commit 04f726aef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<TabbedPanel> <TabbedPanel>
tab_width: 200 tab_width: root.width / app.tab_count
<SelectableLabel>: <SelectableLabel>:
canvas.before: canvas.before:
Color: Color:

View File

@ -330,6 +330,12 @@ class GameManager(App):
super(GameManager, self).__init__() 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: def build(self) -> Layout:
self.container = ContainerLayout() self.container = ContainerLayout()