added pair screen, home screen, and channels screen

This commit is contained in:
2026-03-08 06:56:18 +11:00
parent 3bcab4414a
commit 83c927d23a
11 changed files with 197 additions and 40 deletions

View File

@@ -0,0 +1,39 @@
from textual.containers import Vertical
from textual.widgets import Button, ContentSwitcher
class SidebarButton(Button):
DEFAULT_CSS = """
SidebarButton {
max-width: 100%;
margin-bottom: 1;
}
"""
class HomeSidebar(Vertical):
DEFAULT_CSS = """
HomeSidebar {
width: 11;
background: $boost;
border-right: $surface-lighten-1 tall;
padding: 1;
dock: left;
margin-top: 1;
}
"""
def on_button_pressed(self, event: Button.Pressed):
content_switcher: ContentSwitcher = self.screen.query_one(ContentSwitcher)
match event.button.id:
case "home-btn":
content_switcher.current = "home-info"
case "channels-btn":
content_switcher.current = "channels-list"
case "settings-btn":
content_switcher.current = "settings"
def compose(self):
yield SidebarButton("", tooltip="Home", id="home-btn")
yield SidebarButton("", tooltip="Channels", id="channels-btn")
yield SidebarButton("", tooltip="Settings", id="settings-btn")