we have a very basic search system working
This commit is contained in:
47
screens/welcome_screen.py
Normal file
47
screens/welcome_screen.py
Normal 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)
|
||||
Reference in New Issue
Block a user