2026-01-13 16:06:57 +11:00
|
|
|
from textual.app import App, ComposeResult
|
2026-01-14 14:43:57 +11:00
|
|
|
from textual.widgets import Footer, Tab, Tabs, Header
|
2026-01-13 16:06:57 +11:00
|
|
|
|
|
|
|
|
from ui.widgets.sidebar import Sidebar
|
|
|
|
|
from ui.widgets.timeline import Timeline
|
2026-01-13 21:33:25 +11:00
|
|
|
from ui.widgets.project_settings import ProjectSettings
|
2026-01-13 16:06:57 +11:00
|
|
|
|
2026-01-14 14:43:57 +11:00
|
|
|
from song_player import SongPlayer
|
|
|
|
|
|
2026-01-13 16:06:57 +11:00
|
|
|
|
|
|
|
|
class AppUI(App):
|
2026-01-14 10:31:26 +11:00
|
|
|
CSS_PATH = "../assets/style.tcss"
|
|
|
|
|
|
2026-01-14 14:43:57 +11:00
|
|
|
theme = "tokyo-night"
|
|
|
|
|
#ENABLE_COMMAND_PALETTE = False
|
|
|
|
|
|
2026-01-14 09:11:09 +11:00
|
|
|
def __init__(self, project):
|
2026-01-13 20:06:28 +11:00
|
|
|
super().__init__()
|
2026-01-14 07:02:32 +11:00
|
|
|
self.zoom_level = 0.05
|
2026-01-14 12:20:53 +11:00
|
|
|
self.last_zoom_level = self.zoom_level
|
2026-01-14 09:11:09 +11:00
|
|
|
self.project = project
|
|
|
|
|
|
2026-01-14 14:43:57 +11:00
|
|
|
self.song_player = SongPlayer(self)
|
|
|
|
|
|
|
|
|
|
def on_mount(self):
|
|
|
|
|
self.song_player.play_song(self.app.project)
|
2026-01-13 20:06:28 +11:00
|
|
|
|
2026-01-13 16:06:57 +11:00
|
|
|
def compose(self) -> ComposeResult:
|
2026-01-14 14:43:57 +11:00
|
|
|
with Tabs(id="top-menu"):
|
|
|
|
|
yield Tab("File")
|
|
|
|
|
yield Tab("Edit")
|
|
|
|
|
yield Tab("View")
|
|
|
|
|
yield Tab("Help")
|
2026-01-13 16:06:57 +11:00
|
|
|
yield Sidebar()
|
|
|
|
|
yield Timeline()
|
2026-01-13 21:33:25 +11:00
|
|
|
yield ProjectSettings()
|
2026-01-13 16:06:57 +11:00
|
|
|
yield Footer()
|