mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Slightly eased conditions for selection mode to avoid shaky animations.
This commit is contained in:
@@ -3657,12 +3657,14 @@ HistoryView::SelectionModeResult HistoryInner::inSelectionMode() const {
|
||||
const auto inSelectionMode = [&] {
|
||||
if (hasSelectedItems()) {
|
||||
return true;
|
||||
} else if (_mouseAction == MouseAction::Selecting
|
||||
&& _dragSelFrom
|
||||
&& _dragSelTo) {
|
||||
}
|
||||
const auto isSelecting = _mouseAction == MouseAction::Selecting;
|
||||
if (isSelecting && _dragSelFrom && _dragSelTo) {
|
||||
return true;
|
||||
} else if (_chooseForReportReason.has_value()) {
|
||||
return true;
|
||||
} else if (_lastInSelectionMode && isSelecting) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
||||
@@ -1230,7 +1230,9 @@ bool ListWidget::hasSelectedItems() const {
|
||||
}
|
||||
|
||||
SelectionModeResult ListWidget::inSelectionMode() const {
|
||||
const auto now = hasSelectedItems() || !_dragSelected.empty();
|
||||
const auto now = hasSelectedItems()
|
||||
|| !_dragSelected.empty()
|
||||
|| (_mouseAction == MouseAction::Selecting && _lastInSelectionMode);
|
||||
if (_lastInSelectionMode != now) {
|
||||
_lastInSelectionMode = now;
|
||||
if (_inSelectionModeAnimation.animating()) {
|
||||
|
||||
Reference in New Issue
Block a user