2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix couple of visual glitches.

Fixes #8676.
This commit is contained in:
John Preston
2020-10-01 16:29:09 +03:00
parent 784f10678c
commit c6ef2b057e
3 changed files with 15 additions and 9 deletions

View File

@@ -1450,11 +1450,6 @@ void RepliesWidget::saveState(not_null<RepliesMemento*> memento) {
void RepliesWidget::restoreState(not_null<RepliesMemento*> memento) {
const auto setReplies = [&](std::shared_ptr<Data::RepliesList> replies) {
_replies = std::move(replies);
_replies->fullCount(
) | rpl::take(1) | rpl::start_with_next([=] {
_loaded = true;
updatePinnedVisibility();
}, lifetime());
rpl::combine(
rpl::single(0) | rpl::then(_replies->fullCount()),
@@ -1663,7 +1658,18 @@ rpl::producer<Data::MessagesSlice> RepliesWidget::listSource(
Data::MessagePosition aroundId,
int limitBefore,
int limitAfter) {
return _replies->source(aroundId, limitBefore, limitAfter);
return _replies->source(
aroundId,
limitBefore,
limitAfter
) | rpl::before_next([=] { // after_next makes a copy of value.
if (!_loaded) {
_loaded = true;
crl::on_main(this, [=] {
updatePinnedVisibility();
});
}
});
}
bool RepliesWidget::listAllowsMultiSelect() {

View File

@@ -155,7 +155,7 @@ QSize Gif::countOptimalSize() {
_thumbh = th;
auto maxWidth = qMax(tw, st::minPhotoSize);
auto minHeight = qMax(th, st::minPhotoSize);
accumulate_max(maxWidth, _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
accumulate_max(maxWidth, _parent->minWidthForMedia());
if (!activeCurrentStreamed()) {
accumulate_max(maxWidth, gifMaxStatusWidth(_data) + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
}
@@ -212,7 +212,7 @@ QSize Gif::countCurrentSize(int newWidth) {
newWidth = qMax(tw, st::minPhotoSize);
auto newHeight = qMax(th, st::minPhotoSize);
accumulate_max(newWidth, _parent->infoWidth() + 2 * st::msgDateImgDelta + st::msgDateImgPadding.x());
accumulate_max(newWidth, _parent->minWidthForMedia());
if (!activeCurrentStreamed()) {
accumulate_max(newWidth, gifMaxStatusWidth(_data) + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
}