diff --git a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp index 5951761c91..cfe5302593 100644 --- a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp +++ b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_common.cpp @@ -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; diff --git a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp index 2997ca0e5f..47ae5dce5d 100644 --- a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp +++ b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp @@ -840,9 +840,6 @@ void InnerWidget::validateButtons() { } } auto &view = views.back(); - const auto callback = _addingToCollectionId - ? Fn([=] { 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 {