-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShellText.py
More file actions
61 lines (53 loc) · 1.27 KB
/
ShellText.py
File metadata and controls
61 lines (53 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from textual.app import App, ComposeResult
from textual.containers import Horizontal, VerticalScroll
from textual.screen import Screen
from textual.widgets import Static, TextArea, Placeholder
__version__ = '0.0.2'
class Header(Placeholder):
DEFAULT_CSS = """
Header {
height: 1;
dock: top;
background: blue;
}
"""
class Footer(Placeholder):
DEFAULT_CSS = """
Footer {
height: 1;
dock: bottom;
background: blue;
}
"""
class Menu(Static):
DEFAULT_CSS = """
Menu {
width: 32;
dock: left;
background: red 30%;
height: 100%;
}
"""
class MainContent(VerticalScroll):
DEFAULT_CSS = """
MainContent {
# background: grey;
color: white;
height: auto;
}
"""
def compose(self) -> ComposeResult:
yield TextArea(id="body")
class AppScreen(Screen):
def compose(self) -> ComposeResult:
yield Header(id="header")
yield Footer(id="footer")
with Horizontal():
yield Menu(id="menu")
yield MainContent(id="main_content")
class LayoutApp(App):
def on_ready(self) -> None:
self.push_screen(AppScreen())
if __name__ == "__main__":
app = LayoutApp()
app.run()