diff --git a/bouquin/main_window.py b/bouquin/main_window.py index bceaa8d..5208e7b 100644 --- a/bouquin/main_window.py +++ b/bouquin/main_window.py @@ -206,6 +206,8 @@ class MainWindow(QMainWindow): self._dirty = False # track which date the editor currently represents self._active_date_iso = date_iso + qd = QDate.fromString(date_iso, "yyyy-MM-dd") + self.calendar.setSelectedDate(qd) def _on_text_changed(self): self._dirty = True diff --git a/bouquin/search.py b/bouquin/search.py index 8177905..8cd2fd5 100644 --- a/bouquin/search.py +++ b/bouquin/search.py @@ -80,7 +80,7 @@ class Search(QWidget): for date_str, content in rows: # Build an HTML fragment around the match and whether to show ellipses frag_html, left_ell, right_ell = self._make_html_snippet( - content, query, radius=60, maxlen=180 + content, query, radius=30, maxlen=90 ) # ---- Per-item widget: date on top, preview row below (with ellipses) ---- @@ -112,7 +112,7 @@ class Search(QWidget): preview = QLabel() preview.setTextFormat(Qt.TextFormat.RichText) preview.setWordWrap(True) - preview.setOpenExternalLinks(True) # keep links in your HTML clickable + preview.setOpenExternalLinks(True) preview.setText( frag_html if frag_html