Reverts all spinner/loading indicator changes and debug code.
Restores the exact code from commit 0e02ba6 which was confirmed working.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
969 B
Python
29 lines
969 B
Python
from textual.app import ComposeResult
|
|
from textual.screen import ModalScreen
|
|
from textual.widgets import Static, Button
|
|
from textual.containers import Horizontal, Vertical
|
|
|
|
|
|
class ConfirmDialog(ModalScreen[bool]):
|
|
|
|
BINDINGS = [("escape", "cancel", "Cancel")]
|
|
|
|
def __init__(self, message: str, title: str = "Confirm"):
|
|
super().__init__()
|
|
self._message = message
|
|
self._title = title
|
|
|
|
def compose(self) -> ComposeResult:
|
|
with Vertical(id="confirm-dialog"):
|
|
yield Static(self._title, id="cd-title")
|
|
yield Static(self._message, id="cd-message")
|
|
with Horizontal(id="cd-buttons"):
|
|
yield Button("Yes", variant="primary", id="cd-yes")
|
|
yield Button("No", variant="default", id="cd-no")
|
|
|
|
def on_button_pressed(self, event: Button.Pressed) -> None:
|
|
self.dismiss(event.button.id == "cd-yes")
|
|
|
|
def action_cancel(self) -> None:
|
|
self.dismiss(False)
|