mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Removed duplicated callback on press on gift in gifts list section.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user