|
25 | 25 | from textual.widget import Widget
|
26 | 26 | from textual.widgets import Footer
|
27 | 27 | from textual.widgets import Label
|
28 |
| -from textual.widgets import ListItem |
29 |
| -from textual.widgets import ListView |
30 | 28 | from textual.widgets import TextArea
|
31 | 29 | from textual.widgets import Tree
|
32 | 30 | from textual.widgets.tree import TreeNode
|
@@ -120,23 +118,20 @@ def compose(self) -> ComposeResult:
|
120 | 118 | text.can_focus = False
|
121 | 119 | text.cursor_blink = False
|
122 | 120 |
|
123 |
| - list_view = ListView( |
124 |
| - ListItem(Label(f":compass: Function: {function}", id="function")), |
125 |
| - ListItem(Label(f":compass: Location: {file}:{line}", id="location")), |
126 |
| - ListItem( |
127 |
| - Label( |
128 |
| - f":floppy_disk: Allocations: {self.frame.n_allocations}", |
129 |
| - id="allocs", |
130 |
| - ) |
| 121 | + node_metadata = Vertical( |
| 122 | + Label(f":compass: Function: {function}", id="function"), |
| 123 | + Label(f":compass: Location: {file}:{line}", id="location"), |
| 124 | + Label( |
| 125 | + f":floppy_disk: Allocations: {self.frame.n_allocations}", |
| 126 | + id="allocs", |
131 | 127 | ),
|
132 |
| - ListItem(Label(f":package: Size: {size_fmt(self.frame.value)}", id="size")), |
133 |
| - ListItem(Label(f":thread: Thread: {self.frame.thread_id}", id="thread")), |
| 128 | + Label(f":package: Size: {size_fmt(self.frame.value)}", id="size"), |
| 129 | + Label(f":thread: Thread: {self.frame.thread_id}", id="thread"), |
134 | 130 | )
|
135 |
| - list_view.can_focus = False |
136 | 131 |
|
137 | 132 | yield Grid(
|
138 | 133 | text,
|
139 |
| - list_view, |
| 134 | + node_metadata, |
140 | 135 | id="frame-detail-grid",
|
141 | 136 | )
|
142 | 137 |
|
@@ -178,6 +173,13 @@ class TreeApp(App[None]):
|
178 | 173 | padding: 1 3;
|
179 | 174 | }
|
180 | 175 |
|
| 176 | + #frame-detail-grid Label { |
| 177 | + color: $text; |
| 178 | + height: auto; |
| 179 | + width: 100%; |
| 180 | + background: $panel-lighten-1; |
| 181 | + } |
| 182 | +
|
181 | 183 | #frame-detail-grid {
|
182 | 184 | grid-size: 1 2;
|
183 | 185 | grid-gutter: 1 2;
|
|
0 commit comments