Reduce size of preview. Fix jumping to the appropriate day in calendar when clicking on a search result

This commit is contained in:
Miguel Jacq 2025-11-02 10:21:42 +11:00
parent 39c0cb61da
commit baf9b41f44
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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