mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix viewing gifts from the list.
This commit is contained in:
parent
c9cfe9e90f
commit
9aa80976ff
1 changed files with 10 additions and 10 deletions
|
@ -343,11 +343,11 @@ void InnerWidget::validateButtons() {
|
||||||
}
|
}
|
||||||
const auto giftId = _entries[index].gift.info.id;
|
const auto giftId = _entries[index].gift.info.id;
|
||||||
const auto manageId = _entries[index].gift.manageId;
|
const auto manageId = _entries[index].gift.manageId;
|
||||||
|
const auto &descriptor = _entries[index].descriptor;
|
||||||
const auto already = ranges::find(_views, giftId, &View::giftId);
|
const auto already = ranges::find(_views, giftId, &View::giftId);
|
||||||
if (already != end(_views)) {
|
if (already != end(_views)) {
|
||||||
views.push_back(base::take(*already));
|
views.push_back(base::take(*already));
|
||||||
} else {
|
} else {
|
||||||
const auto &descriptor = _entries[index].descriptor;
|
|
||||||
const auto unused = ranges::find_if(_views, [&](const View &v) {
|
const auto unused = ranges::find_if(_views, [&](const View &v) {
|
||||||
return v.button && !idUsed(v.giftId, column, row);
|
return v.button && !idUsed(v.giftId, column, row);
|
||||||
});
|
});
|
||||||
|
@ -358,16 +358,16 @@ void InnerWidget::validateButtons() {
|
||||||
button->show();
|
button->show();
|
||||||
views.push_back({ .button = std::move(button) });
|
views.push_back({ .button = std::move(button) });
|
||||||
}
|
}
|
||||||
auto &view = views.back();
|
|
||||||
const auto callback = [=] {
|
|
||||||
showGift(index);
|
|
||||||
};
|
|
||||||
view.index = index;
|
|
||||||
view.manageId = manageId;
|
|
||||||
view.giftId = giftId;
|
|
||||||
view.button->setDescriptor(descriptor, mode);
|
|
||||||
view.button->setClickedCallback(callback);
|
|
||||||
}
|
}
|
||||||
|
auto &view = views.back();
|
||||||
|
const auto callback = [=] {
|
||||||
|
showGift(index);
|
||||||
|
};
|
||||||
|
view.index = index;
|
||||||
|
view.manageId = manageId;
|
||||||
|
view.giftId = giftId;
|
||||||
|
view.button->setDescriptor(descriptor, mode);
|
||||||
|
view.button->setClickedCallback(callback);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
for (auto j = fromRow; j != tillRow; ++j) {
|
for (auto j = fromRow; j != tillRow; ++j) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue