mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Slightly eased conditions for selection mode to avoid shaky animations.
This commit is contained in:
parent
7b4bd5696b
commit
54b0d965ae
2 changed files with 8 additions and 4 deletions
|
@ -3657,12 +3657,14 @@ HistoryView::SelectionModeResult HistoryInner::inSelectionMode() const {
|
||||||
const auto inSelectionMode = [&] {
|
const auto inSelectionMode = [&] {
|
||||||
if (hasSelectedItems()) {
|
if (hasSelectedItems()) {
|
||||||
return true;
|
return true;
|
||||||
} else if (_mouseAction == MouseAction::Selecting
|
}
|
||||||
&& _dragSelFrom
|
const auto isSelecting = _mouseAction == MouseAction::Selecting;
|
||||||
&& _dragSelTo) {
|
if (isSelecting && _dragSelFrom && _dragSelTo) {
|
||||||
return true;
|
return true;
|
||||||
} else if (_chooseForReportReason.has_value()) {
|
} else if (_chooseForReportReason.has_value()) {
|
||||||
return true;
|
return true;
|
||||||
|
} else if (_lastInSelectionMode && isSelecting) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}();
|
}();
|
||||||
|
|
|
@ -1230,7 +1230,9 @@ bool ListWidget::hasSelectedItems() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectionModeResult ListWidget::inSelectionMode() const {
|
SelectionModeResult ListWidget::inSelectionMode() const {
|
||||||
const auto now = hasSelectedItems() || !_dragSelected.empty();
|
const auto now = hasSelectedItems()
|
||||||
|
|| !_dragSelected.empty()
|
||||||
|
|| (_mouseAction == MouseAction::Selecting && _lastInSelectionMode);
|
||||||
if (_lastInSelectionMode != now) {
|
if (_lastInSelectionMode != now) {
|
||||||
_lastInSelectionMode = now;
|
_lastInSelectionMode = now;
|
||||||
if (_inSelectionModeAnimation.animating()) {
|
if (_inSelectionModeAnimation.animating()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue