we have a very basic search system working

This commit is contained in:
2026-02-04 19:30:41 +11:00
parent 33ce1aac67
commit de101e8dfb
6 changed files with 213 additions and 0 deletions

47
screens/welcome_screen.py Normal file
View File

@@ -0,0 +1,47 @@
from textual.containers import Vertical, HorizontalGroup, Center
from textual.screen import Screen
from textual.app import ComposeResult
from textual.widgets import Static, Button
from textualeffects.widgets import EffectLabel, EffectType, effects
from widgets import Navbar
from random import choice
class WelcomeScreen(Screen):
DEFAULT_CSS = """
Center {
padding: 2;
width: 100%;
Static {
text-align: center;
}
EffectLabel {
text-style: bold;
min-width: 100%;
}
#buttons {
margin-top: 1;
align: center middle;
Button {
margin: 0 2;
}
}
}
"""
def compose(self) -> ComposeResult:
yield Navbar()
with Center():
with open("banner.txt", "r") as f:
yield EffectLabel(text=f.read(), effect=choice(list(effects.keys())))
yield Static("[d]Gitea, in your terminal.[/]")
with HorizontalGroup(id="buttons"):
yield Button("Explore", variant="primary", flat=True)
yield Button("another button lol", flat=True)