diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-24 16:58:48 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-24 16:58:48 +0200 |
| commit | 06cfa9352e1da8ffb44e35a28523755db8dbf7e2 (patch) | |
| tree | a36ee4a5b0d6370148e0a096a5d5cc8e1a484f8e /src/monthview.cpp | |
| parent | c015b7efe076222d34e1a32e1cfa8457be1cf309 (diff) | |
| download | qtmaildir-06cfa9352e1da8ffb44e35a28523755db8dbf7e2.tar.gz qtmaildir-06cfa9352e1da8ffb44e35a28523755db8dbf7e2.zip | |
fix: swallow the calendar more-line double-click and clear the agenda selection
Diffstat (limited to 'src/monthview.cpp')
| -rw-r--r-- | src/monthview.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/monthview.cpp b/src/monthview.cpp index 7d0df3b..b1c5520 100644 --- a/src/monthview.cpp +++ b/src/monthview.cpp @@ -156,6 +156,8 @@ void MonthView::paintEvent(QPaintEvent *) void MonthView::mousePressEvent(QMouseEvent *event) { + if (event->button() != Qt::LeftButton) + return; const MonthLayout l = layout(); const int cell = l.cellAt(event->position().toPoint()); if (cell < 0) @@ -178,10 +180,14 @@ void MonthView::mouseDoubleClickEvent(QMouseEvent *event) const int cell = l.cellAt(event->position().toPoint()); if (cell < 0) return; - // A double-click on a chip is two clicks on the chip, not a new event. + // A double-click on a chip, or on the "+N more" line, is two clicks on + // that thing, not a new event. const QList<int> items = itemsPerCell(l)[cell]; - for (int slot = 0; slot < l.visibleChips(items.size()); ++slot) + const int shown = l.visibleChips(items.size()); + for (int slot = 0; slot < shown; ++slot) if (l.chipRect(cell, slot).contains(event->position().toPoint())) return; + if (shown < items.size() && l.chipRect(cell, shown).contains(event->position().toPoint())) + return; emit dayDoubleClicked(l.dateAt(cell)); } |
