Files
Terminal-DAW/src/ui/widgets/sidebar.py

36 lines
997 B
Python
Raw Normal View History

2026-01-13 16:06:57 +11:00
from textual.containers import Vertical, VerticalScroll, Horizontal
from textual.widgets import Button, ListView
from textual.app import ComposeResult
from ui.widgets.channel import Channel
class Sidebar(Vertical):
DEFAULT_CSS = """
Sidebar {
dock: left;
background: $surface;
2026-01-14 14:43:57 +11:00
width: 43;
2026-01-13 16:06:57 +11:00
border-right: tall $surface-lighten-1;
padding: 1;
2026-01-14 14:43:57 +11:00
margin-top: 1;
2026-01-13 16:06:57 +11:00
#add-channel {
min-width: 100%;
margin: 1
}
}
"""
def compose(self) -> ComposeResult:
with VerticalScroll(id="channels"):
2026-01-14 14:43:57 +11:00
for i, channel in enumerate(self.app.project.channels):
yield Channel(
2026-01-14 14:43:57 +11:00
i,
channel.name,
channel.mute,
channel.solo,
channel.pan,
channel.volume
)
2026-01-13 16:06:57 +11:00
yield Button("+ New Channel", variant="success", id="add-channel")