From f1199852a22bcc6d3d44a6a2c903d40a60949666 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 27 Feb 2026 11:33:09 +0400 Subject: [PATCH] Select messages by timestamp clicks. --- .../SourceFiles/history/history_inner_widget.cpp | 9 +++++++++ .../history/view/history_view_list_widget.cpp | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 557d873d83..58ea628c7d 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2217,6 +2217,15 @@ void HistoryInner::mouseActionFinish( _selected.emplace(_dragStateItem, FullSelection); repaintItem(_mouseActionItem); } + } else if (_mouseCursorState == CursorState::Date + && !hasSelectRestriction() + && _dragStateItem->isRegular() + && !_dragStateItem->isService()) { + changeSelectionAsGroup( + &_selected, + _dragStateItem, + SelectAction::Select); + repaintItem(_mouseActionItem); } else { _selected.clear(); update(); diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 714399ddc6..dc2f7dae86 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -3713,6 +3713,20 @@ void ListWidget::mouseActionFinish( } } else if (needTextSelectionClear) { clearTextSelection(); + } else if (simpleSelectionChange + && _mouseCursorState == CursorState::Date + && !hasSelectRestriction()) { + if (const auto item = session().data().message(pressState.itemId)) { + if (_delegate->listIsItemGoodForSelection(item)) { + clearTextSelection(); + changeSelectionAsGroup( + _selected, + item, + SelectAction::Select); + pushSelectedItems(); + update(); + } + } } else if (_mouseAction == MouseAction::Selecting) { if (!_dragSelected.empty()) { applyDragSelection();