building out ui, still not done
This commit is contained in:
@@ -4,6 +4,7 @@ from textual.app import ComposeResult
|
||||
from textual.widgets import Static, Button
|
||||
from textualeffects.widgets import EffectLabel, EffectType, effects
|
||||
|
||||
from screens.search_screen import SearchScreen
|
||||
from widgets import Navbar
|
||||
|
||||
from random import choice
|
||||
@@ -14,7 +15,7 @@ class WelcomeScreen(Screen):
|
||||
Center {
|
||||
padding: 2;
|
||||
width: 100%;
|
||||
|
||||
|
||||
Static {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -33,15 +34,18 @@ class WelcomeScreen(Screen):
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
def on_button_pressed(self, event: Button.Pressed):
|
||||
if event.button.id == "explore":
|
||||
self.app.switch_screen(SearchScreen())
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Navbar()
|
||||
with Center():
|
||||
with open("banner.txt", "r") as f:
|
||||
with open("assets/banner.txt", "r") as f:
|
||||
yield EffectLabel(text=f.read(), effect=choice(list(effects.keys())))
|
||||
|
||||
yield Static("[d]Gitea, in your terminal.[/]")
|
||||
yield Static("[white]Gitea, in your terminal.")
|
||||
|
||||
with HorizontalGroup(id="buttons"):
|
||||
yield Button("Explore", variant="primary", flat=True)
|
||||
yield Button("another button lol", flat=True)
|
||||
yield Button("\uee45 Explore", variant="primary", flat=True, id="explore")
|
||||
Reference in New Issue
Block a user