From 85eb4232c8102d375dc7b6057214223a4a077a4b Mon Sep 17 00:00:00 2001 From: shuki Date: Thu, 5 Mar 2026 23:50:07 +0200 Subject: [PATCH] Layout logo on left, menu on right in main screen Use Horizontal container with logo-panel and menu-panel side by side, centered vertically in the terminal. Co-Authored-By: Claude Opus 4.6 --- tui/gniza.tcss | 23 +++++++++++++++++------ tui/screens/main_menu.py | 7 ++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/tui/gniza.tcss b/tui/gniza.tcss index 67caa04..0568613 100644 --- a/tui/gniza.tcss +++ b/tui/gniza.tcss @@ -12,11 +12,24 @@ Screen { } /* Main menu */ -#main-menu { - width: 1fr; - max-width: 60; +#main-layout { + width: 100%; + height: 1fr; + align: center middle; +} + +#logo-panel { + width: auto; + height: auto; + padding: 1 2; + align: center middle; +} + +#menu-panel { + width: 1fr; + max-width: 40; + height: auto; padding: 1 2; - overflow-y: auto; } #menu-list { @@ -26,9 +39,7 @@ Screen { } #logo { - text-align: center; height: auto; - padding: 0; } /* Data tables */ diff --git a/tui/screens/main_menu.py b/tui/screens/main_menu.py index eb21869..d6145b0 100644 --- a/tui/screens/main_menu.py +++ b/tui/screens/main_menu.py @@ -2,7 +2,7 @@ from textual.app import ComposeResult from textual.screen import Screen from textual.widgets import Header, Footer, Static, OptionList from textual.widgets.option_list import Option -from textual.containers import Vertical, Center +from textual.containers import Horizontal, Vertical LOGO = """\ [green] @@ -35,9 +35,10 @@ class MainMenuScreen(Screen): def compose(self) -> ComposeResult: yield Header() - with Center(): - with Vertical(id="main-menu"): + with Horizontal(id="main-layout"): + with Vertical(id="logo-panel"): yield Static(LOGO, id="logo", markup=True) + with Vertical(id="menu-panel"): yield OptionList( *[Option(label, id=mid) for mid, label in MENU_ITEMS], id="menu-list",