j
This commit is contained in:
@@ -7,6 +7,7 @@ from textual.containers import Container, Horizontal, ScrollableContainer, Verti
|
||||
from textual.screen import ModalScreen
|
||||
from textual.widgets import Static, Button, Checkbox
|
||||
from textual import work
|
||||
from rich.text import Text
|
||||
|
||||
|
||||
class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
@@ -45,30 +46,13 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
|
||||
.matrix-room-row {
|
||||
border-bottom: solid $surface;
|
||||
padding: 1 0;
|
||||
padding: 0.5 0;
|
||||
align: left middle;
|
||||
background: $surface;
|
||||
}
|
||||
|
||||
.matrix-room-checkbox {
|
||||
width: 3;
|
||||
padding: 0;
|
||||
margin-right: 1;
|
||||
}
|
||||
|
||||
.matrix-room-meta {
|
||||
padding: 0 1;
|
||||
}
|
||||
|
||||
.matrix-room-name {
|
||||
padding-left: 1;
|
||||
content-align: left middle;
|
||||
color: $text;
|
||||
}
|
||||
|
||||
.matrix-room-id {
|
||||
content-align: left middle;
|
||||
text-style: dim;
|
||||
color: $text-muted;
|
||||
}
|
||||
|
||||
#matrix-room-actions {
|
||||
@@ -149,17 +133,19 @@ class MatrixRoomPicker(ModalScreen[List[str]]):
|
||||
checkbox = Checkbox(
|
||||
"",
|
||||
id=checkbox_id,
|
||||
classes="matrix-room-checkbox",
|
||||
value=bool(room_id and room_id in self._existing_ids),
|
||||
)
|
||||
self._checkbox_map[checkbox_id] = room_id
|
||||
info = Vertical(classes="matrix-room-meta")
|
||||
info.mount(Static(name or room_id or "Matrix Room", classes="matrix-room-name"))
|
||||
info.mount(Static(room_id or "(no id)", classes="matrix-room-id"))
|
||||
|
||||
label = Text(name or room_id or "Matrix Room")
|
||||
label.stylize("bold")
|
||||
label.append("\n")
|
||||
label.append(room_id or "(no id)", style="dim")
|
||||
|
||||
row = Horizontal(classes="matrix-room-row")
|
||||
self._checklist.mount(row)
|
||||
row.mount(checkbox)
|
||||
row.mount(info)
|
||||
row.mount(Static(label, classes="matrix-room-meta"))
|
||||
self._set_status("Loaded rooms. Select one or more and save.")
|
||||
if self._save_button:
|
||||
self._save_button.disabled = False
|
||||
|
||||
Reference in New Issue
Block a user