Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/history_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ def _setup_ui(self) -> None:
self._btn_clear.clicked.connect(self._on_clear_clicked)
header_row.addWidget(self._btn_clear)

self._btn_close = QPushButton(t("history.button.close"))
self._btn_close.clicked.connect(self.close)
header_row.addWidget(self._btn_close)

layout.addLayout(header_row)

self._scroll = QScrollArea()
Expand All @@ -304,6 +308,13 @@ def _setup_ui(self) -> None:
self._empty_label.setProperty("role", "muted")
self._list_layout.insertWidget(0, self._empty_label, 1)

def keyPressEvent(self, event) -> None: # noqa: N802
if event.key() == Qt.Key.Key_Escape:
self.close()
event.accept()
return
super().keyPressEvent(event)

def add_entry(self, text: str, is_dictation: bool = False, source: Optional[str] = None) -> None:
if not text or not text.strip():
return
Expand Down
2 changes: 2 additions & 0 deletions app/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"history.tooltip.merge": "Alle Diktat-Einträge kombinieren, als Datei speichern und kopieren",
"history.header": "Verlauf ({count})",
"history.button.merge": "Zusammenführen",
"history.button.close": "Schließen",
"history.button.clear_all": "Alles löschen",
"history.button.confirm_clear": "Sicher?",
"history.status.saved": "✓ Gespeichert",
Expand Down Expand Up @@ -404,6 +405,7 @@
"history.tooltip.merge": "Combine all dictation entries, save as a file, and copy",
"history.header": "History ({count})",
"history.button.merge": "Merge",
"history.button.close": "Close",
"history.button.clear_all": "Delete all",
"history.button.confirm_clear": "Sure?",
"history.status.saved": "✓ Saved",
Expand Down
8 changes: 8 additions & 0 deletions app/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ def __init__(self, owner: "MainWindow") -> None:
self.setAttribute(Qt.WidgetAttribute.WA_StyledBackground, True)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)

def keyPressEvent(self, event) -> None: # noqa: N802
if event.key() == Qt.Key.Key_Escape:
self.hide()
event.accept()
return
super().keyPressEvent(event)


class MainWindow(QWidget):
"""One frameless surface with header, microphone, status and tools.
Expand Down Expand Up @@ -688,6 +695,7 @@ def _on_discard_clicked(self) -> None:
def _on_dictation_clicked(self) -> None:
self._update_dictation_text()
self._controller.set_dictation_mode(self._btn_dictation.isChecked())
self._options_popup.hide()

def update_state(self, state: str, workflow: Optional[WorkflowType], error: Optional[str]) -> None:
self._state = state
Expand Down
Loading