mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Attempt to fix possible crash in quick action.
This commit is contained in:
@@ -2113,6 +2113,7 @@ bool InnerWidget::addQuickActionRipple(
|
||||
}
|
||||
|
||||
auto name = ResolveQuickDialogLottieIconName(type);
|
||||
const auto rowHeight = row->height();
|
||||
context->icon = Lottie::MakeIcon({
|
||||
.name = std::move(name),
|
||||
.sizeOverride = Size(st::dialogsQuickActionSize),
|
||||
@@ -2121,16 +2122,12 @@ bool InnerWidget::addQuickActionRipple(
|
||||
context->icon->jumpTo(context->icon->framesCount() - 1, [=] {
|
||||
const auto size = QSize(
|
||||
st::dialogsQuickActionRippleSize,
|
||||
row->height());
|
||||
const auto isRemovingFromList
|
||||
= (action == Dialogs::Ui::QuickDialogAction::Archive);
|
||||
rowHeight);
|
||||
if (!context->ripple) {
|
||||
context->ripple = std::make_unique<Ui::RippleAnimation>(
|
||||
st::defaultRippleAnimation,
|
||||
Ui::RippleAnimation::RectMask(size),
|
||||
isRemovingFromList
|
||||
? Fn<void()>([=] { update(); })
|
||||
: updateCallback);
|
||||
updateCallback);
|
||||
}
|
||||
if (!context->rippleFg) {
|
||||
context->rippleFg = std::make_unique<Ui::RippleAnimation>(
|
||||
@@ -2147,13 +2144,11 @@ bool InnerWidget::addQuickActionRipple(
|
||||
Rect(size),
|
||||
context->icon.get(),
|
||||
ResolveQuickDialogLabel(
|
||||
row->history(),
|
||||
history,
|
||||
action,
|
||||
_filterId));
|
||||
}),
|
||||
isRemovingFromList
|
||||
? Fn<void()>([=] { update(); })
|
||||
: std::move(updateCallback));
|
||||
std::move(updateCallback));
|
||||
}
|
||||
context->ripple->add(QPoint(size.width() / 2, size.height() / 2));
|
||||
context->rippleFg->add(QPoint(size.width() / 2, size.height() / 2));
|
||||
|
||||
Reference in New Issue
Block a user