added pair screen, home screen, and channels screen
This commit is contained in:
55
desktop_app/ui/widgets/channels_list.py
Normal file
55
desktop_app/ui/widgets/channels_list.py
Normal file
@@ -0,0 +1,55 @@
|
||||
from textual.containers import VerticalScroll, Vertical, HorizontalGroup
|
||||
from textual.widgets import Static, Button, Rule
|
||||
|
||||
from api.channel import Channel
|
||||
|
||||
|
||||
class ChannelView(Button):
|
||||
DEFAULT_CSS = """
|
||||
ChannelView {
|
||||
margin: 0 1;
|
||||
background: $boost;
|
||||
border: $surface-lighten-1 tall;
|
||||
content-align: left middle;
|
||||
text-align: left;
|
||||
width: 30;
|
||||
}
|
||||
"""
|
||||
|
||||
def __init__(self, channel: Channel):
|
||||
super().__init__(" [b]" + channel.name, flat=True)
|
||||
self.channel = channel
|
||||
|
||||
class ChannelsList(Vertical):
|
||||
DEFAULT_CSS = """
|
||||
ChannelsList {
|
||||
Rule {
|
||||
color: $surface-lighten-1;
|
||||
}
|
||||
|
||||
#buttons {
|
||||
margin-bottom: 1;
|
||||
|
||||
Button {
|
||||
margin: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
def compose(self):
|
||||
with VerticalScroll():
|
||||
yield Static("channels", classes="banner")
|
||||
yield ChannelView(Channel("test channel", "AQ=="))
|
||||
yield ChannelView(Channel("test channel", "AQ=="))
|
||||
yield ChannelView(Channel("test channel", "AQ=="))
|
||||
yield ChannelView(Channel("test channel", "AQ=="))
|
||||
yield ChannelView(Channel("test channel", "AQ=="))
|
||||
yield ChannelView(Channel("test channel", "AQ=="))
|
||||
yield ChannelView(Channel("test channel", "AQ=="))
|
||||
|
||||
yield Rule()
|
||||
|
||||
with HorizontalGroup(id="buttons"):
|
||||
yield Button("Create Channel")
|
||||
yield Button("Advertise")
|
||||
Reference in New Issue
Block a user