mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Fixed userpic updating of pinned peers in touchbar.
This commit is contained in:
parent
e85026ec46
commit
a425024f21
1 changed files with 10 additions and 6 deletions
|
@ -441,7 +441,8 @@ TimeId CalculateOnlineTill(not_null<PeerData*> peer) {
|
||||||
_gestures.events(
|
_gestures.events(
|
||||||
) | rpl::filter([=] {
|
) | rpl::filter([=] {
|
||||||
return !(*waitForFinish);
|
return !(*waitForFinish);
|
||||||
}) | rpl::start_with_next([=](not_null<NSPressGestureRecognizer*> gesture) {
|
}) | rpl::start_with_next([=](
|
||||||
|
not_null<NSPressGestureRecognizer*> gesture) {
|
||||||
const auto currentPosition = [gesture locationInView:self].x;
|
const auto currentPosition = [gesture locationInView:self].x;
|
||||||
|
|
||||||
switch ([gesture state]) {
|
switch ([gesture state]) {
|
||||||
|
@ -530,7 +531,8 @@ TimeId CalculateOnlineTill(not_null<PeerData*> peer) {
|
||||||
pin->peer->paintUserpic(p, pin->userpicView, 0, 0, userpic.width());
|
pin->peer->paintUserpic(p, pin->userpicView, 0, 0, userpic.width());
|
||||||
userpic.setDevicePixelRatio(cRetinaFactor());
|
userpic.setDevicePixelRatio(cRetinaFactor());
|
||||||
pin->userpic = std::move(userpic);
|
pin->userpic = std::move(userpic);
|
||||||
[self setNeedsDisplayInRect:PeerRectByIndex(pin->index)];
|
const auto userpicIndex = pin->index + [self shift];
|
||||||
|
[self setNeedsDisplayInRect:PeerRectByIndex(userpicIndex)];
|
||||||
};
|
};
|
||||||
const auto updateUserpics = [=] {
|
const auto updateUserpics = [=] {
|
||||||
ranges::for_each(_pins, singleUserpic);
|
ranges::for_each(_pins, singleUserpic);
|
||||||
|
@ -653,12 +655,15 @@ TimeId CalculateOnlineTill(not_null<PeerData*> peer) {
|
||||||
peerChangedLifetime->destroy();
|
peerChangedLifetime->destroy();
|
||||||
for (const auto &pin : _pins) {
|
for (const auto &pin : _pins) {
|
||||||
const auto peer = pin->peer;
|
const auto peer = pin->peer;
|
||||||
|
const auto index = pin->index;
|
||||||
|
|
||||||
_session->changes().peerUpdates(
|
_session->changes().peerUpdates(
|
||||||
peer,
|
peer,
|
||||||
UpdateFlag::Photo
|
UpdateFlag::Photo
|
||||||
) | rpl::start_with_next(
|
) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
|
||||||
listenToDownloaderFinished,
|
_pins[index]->userpicView = update.peer->createUserpicView();
|
||||||
*peerChangedLifetime);
|
listenToDownloaderFinished();
|
||||||
|
}, *peerChangedLifetime);
|
||||||
|
|
||||||
if (const auto user = peer->asUser()) {
|
if (const auto user = peer->asUser()) {
|
||||||
if (!user->isServiceUser()
|
if (!user->isServiceUser()
|
||||||
|
@ -668,7 +673,6 @@ TimeId CalculateOnlineTill(not_null<PeerData*> peer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto index = pin->index;
|
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
_session->changes().historyUpdates(
|
_session->changes().historyUpdates(
|
||||||
_session->data().history(peer),
|
_session->data().history(peer),
|
||||||
|
|
Loading…
Add table
Reference in a new issue