Restore link styling and clickability
Some checks failed
Lint / test (push) Waiting to run
Trivy / test (push) Waiting to run
CI / test (push) Has been cancelled

This commit is contained in:
Miguel Jacq 2025-11-15 12:32:45 +11:00
parent 97e723ce34
commit 22901d0e51
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
4 changed files with 93 additions and 10 deletions

View file

@ -440,6 +440,7 @@ class MainWindow(QMainWindow):
return self._create_new_tab(date)
def _create_new_tab(self, date: QDate | None = None) -> MarkdownEditor:
"""Create a new editor tab and return the editor instance."""
if date is None:
date = self.calendar.selectedDate()
@ -449,7 +450,6 @@ class MainWindow(QMainWindow):
self.tab_widget.setCurrentIndex(existing)
return self.tab_widget.widget(existing)
"""Create a new editor tab and return the editor instance."""
editor = MarkdownEditor(self.themes)
# Set up the editor's event connections
@ -1129,6 +1129,15 @@ class MainWindow(QMainWindow):
self._load_selected_date()
self._refresh_calendar_marks()
# ------------ Statistics handler --------------- #
def _open_statistics(self):
if not getattr(self, "db", None) or self.db.conn is None:
return
dlg = StatisticsDialog(self.db, self)
dlg.exec()
# ------------ Window positioning --------------- #
def _restore_window_position(self):
geom = self.settings.value("main/geometry", None)
@ -1434,11 +1443,3 @@ class MainWindow(QMainWindow):
super().changeEvent(ev)
if ev.type() == QEvent.ActivationChange and self.isActiveWindow():
QTimer.singleShot(0, self._focus_editor_now)
def _open_statistics(self):
# If the DB isn't ready for some reason, just do nothing
if not getattr(self, "db", None) or self.db.conn is None:
return
dlg = StatisticsDialog(self.db, self)
dlg.exec()