Removed duplicated callback on press on gift in gifts list section.

This commit is contained in:
23rd
2025-10-06 14:10:37 +03:00
committed by John Preston
parent 384f6d9a31
commit 8dd7d04fff
2 changed files with 9 additions and 8 deletions
@@ -538,6 +538,9 @@ void GiftButton::contextMenuEvent(QContextMenuEvent *e) {
}
void GiftButton::mousePressEvent(QMouseEvent *e) {
if (e->button() != Qt::LeftButton) {
return;
}
_mouseEvents.fire_copy(e);
if (e->isAccepted()) {
return;
@@ -546,6 +549,9 @@ void GiftButton::mousePressEvent(QMouseEvent *e) {
}
void GiftButton::mouseMoveEvent(QMouseEvent *e) {
if (e->button() != Qt::LeftButton) {
return;
}
_mouseEvents.fire_copy(e);
if (e->isAccepted()) {
return;
@@ -554,6 +560,9 @@ void GiftButton::mouseMoveEvent(QMouseEvent *e) {
}
void GiftButton::mouseReleaseEvent(QMouseEvent *e) {
if (e->button() != Qt::LeftButton) {
return;
}
_mouseEvents.fire_copy(e);
if (e->isAccepted()) {
return;
@@ -840,9 +840,6 @@ void InnerWidget::validateButtons() {
}
}
auto &view = views.back();
const auto callback = _addingToCollectionId
? Fn<void()>([=] { showGift(index); })
: nullptr;
view.index = index;
view.manageId = manageId;
view.giftId = giftId;
@@ -853,9 +850,6 @@ void InnerWidget::validateButtons() {
anim::type::instant);
}
view.button->setDescriptor(descriptor, _mode);
if (callback) {
view.button->setClickedCallback(callback);
}
return true;
};
for (auto j = fromRow; j != tillRow; ++j) {
@@ -921,8 +915,6 @@ void InnerWidget::validateButtons() {
_inCollection.contains(entry.gift.manageId),
GiftSelectionMode::Check,
anim::type::instant);
const auto callback = [=] { showGift(_dragging.index); };
_draggedView->button->setClickedCallback(callback);
}
_draggedView->button->show();
} else {