-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .terminal_modal import TerminalModal | ||
from .terminal import Terminal, ShellCommand, NonShellCommand, CommandType | ||
from .sidebar import Sidebar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from textual.app import ComposeResult | ||
from textual.containers import Container | ||
from textual.widgets import OptionList | ||
from textual.widgets.option_list import Option, Separator | ||
|
||
|
||
from models import Project | ||
|
||
|
||
class Sidebar(Container): | ||
DEFAULT_CSS = """ | ||
Sidebar { | ||
width: 30; | ||
height: 100%; | ||
dock: left; | ||
background: $primary-background; | ||
layer: sidebar; | ||
OptionList { | ||
margin: 1 0; | ||
border: none; | ||
} | ||
} | ||
Sidebar.-hidden { | ||
display: none; | ||
} | ||
""" | ||
|
||
def __init__(self, project: Project, **kwargs): | ||
self.project = project | ||
super().__init__(**kwargs) | ||
self.add_class("-hidden") | ||
|
||
def compose(self) -> ComposeResult: | ||
yield OptionList( | ||
*(Option(action.label) for action in self.project.actions) | ||
) | ||
# yield OptionList( | ||
# Option("Aerilon", id="aer"), | ||
# Option("Aquaria", id="aqu"), | ||
# Separator(), | ||
# Option("Canceron", id="can"), | ||
# Option("Caprica", id="cap", disabled=True), | ||
# Separator(), | ||
# Option("Gemenon", id="gem"), | ||
# Separator(), | ||
# Option("Leonis", id="leo"), | ||
# Option("Libran", id="lib"), | ||
# Separator(), | ||
# Option("Picon", id="pic"), | ||
# Separator(), | ||
# Option("Sagittaron", id="sag"), | ||
# Option("Scorpia", id="sco"), | ||
# Separator(), | ||
# Option("Tauron", id="tau"), | ||
# Separator(), | ||
# Option("Virgon", id="vir"), | ||
# ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters