mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Attempted to fix rare non-elided text in bar of pinned bot messages.
This commit is contained in:
parent
fa6b4f9b52
commit
49773dde72
1 changed files with 28 additions and 20 deletions
|
@ -6417,8 +6417,7 @@ void HistoryWidget::checkPinnedBarState() {
|
||||||
return controller()->isGifPausedAtLeastFor(
|
return controller()->isGifPausedAtLeastFor(
|
||||||
Window::GifPauseReason::Any);
|
Window::GifPauseReason::Any);
|
||||||
});
|
});
|
||||||
rpl::combine(
|
auto pinnedRefreshed = Info::Profile::SharedMediaCountValue(
|
||||||
Info::Profile::SharedMediaCountValue(
|
|
||||||
_peer,
|
_peer,
|
||||||
nullptr,
|
nullptr,
|
||||||
Storage::SharedMediaType::Pinned
|
Storage::SharedMediaType::Pinned
|
||||||
|
@ -6430,18 +6429,27 @@ void HistoryWidget::checkPinnedBarState() {
|
||||||
updatePinnedViewer();
|
updatePinnedViewer();
|
||||||
}
|
}
|
||||||
return (count > 1);
|
return (count > 1);
|
||||||
}) | rpl::distinct_until_changed(),
|
}) | rpl::distinct_until_changed();
|
||||||
HistoryView::PinnedBarItemWithReplyMarkup(
|
auto markupRefreshed = HistoryView::PinnedBarItemWithReplyMarkup(
|
||||||
&session(),
|
&session(),
|
||||||
_pinnedTracker->shownMessageId())
|
_pinnedTracker->shownMessageId());
|
||||||
|
rpl::combine(
|
||||||
|
rpl::duplicate(pinnedRefreshed),
|
||||||
|
rpl::duplicate(markupRefreshed)
|
||||||
) | rpl::start_with_next([=](bool many, HistoryItem *item) {
|
) | rpl::start_with_next([=](bool many, HistoryItem *item) {
|
||||||
refreshPinnedBarButton(many, item);
|
refreshPinnedBarButton(many, item);
|
||||||
}, _pinnedBar->lifetime());
|
}, _pinnedBar->lifetime());
|
||||||
|
|
||||||
_pinnedBar->setContent(HistoryView::PinnedBarContent(
|
_pinnedBar->setContent(rpl::combine(
|
||||||
|
HistoryView::PinnedBarContent(
|
||||||
&session(),
|
&session(),
|
||||||
_pinnedTracker->shownMessageId(),
|
_pinnedTracker->shownMessageId(),
|
||||||
[bar = _pinnedBar.get()] { bar->customEmojiRepaint(); }));
|
[bar = _pinnedBar.get()] { bar->customEmojiRepaint(); }),
|
||||||
|
std::move(pinnedRefreshed),
|
||||||
|
std::move(markupRefreshed)
|
||||||
|
) | rpl::map([](Ui::MessageBarContent &&content, bool, HistoryItem*) {
|
||||||
|
return std::move(content);
|
||||||
|
}));
|
||||||
|
|
||||||
controller()->adaptive().oneColumnValue(
|
controller()->adaptive().oneColumnValue(
|
||||||
) | rpl::start_with_next([=](bool one) {
|
) | rpl::start_with_next([=](bool one) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue