mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-11 08:48:14 +00:00
Fixed not loaded messages with bot keyboard display
Fixed saved gifs row layout Removed information about channel members count / left to invite in invite-to-channel box (channels have no participants limit)
This commit is contained in:
parent
6710ef3e2f
commit
b86d8638bc
@ -785,7 +785,9 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) {
|
||||
data->check = true;
|
||||
_checkedContacts.insert(peer, true);
|
||||
++_selCount;
|
||||
} else if ((!_channel || !_channel->isMegagroup()) && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) {
|
||||
} else if (_channel && !_channel->isMegagroup()) {
|
||||
Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers);
|
||||
} else if (!_channel && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) {
|
||||
Ui::showLayer(new InformBox(lng_profile_add_more_after_upgrade(lt_count, Global::MegagroupSizeMax())), KeepOtherLayers);
|
||||
}
|
||||
if (cnt != _selCount) emit chosenChanged();
|
||||
@ -1551,7 +1553,7 @@ void ContactsBox::paintEvent(QPaintEvent *e) {
|
||||
paintTitle(p, lang(lng_channel_admins));
|
||||
} else if (_inner.chat() || _inner.creating() != CreatingGroupNone) {
|
||||
QString title(lang(addingAdmin ? lng_channel_add_admin : lng_profile_add_participant));
|
||||
QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax()));
|
||||
QString additional((addingAdmin || (_inner.channel() && !_inner.channel()->isMegagroup())) ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax()));
|
||||
paintTitle(p, title, additional);
|
||||
} else if (_inner.bot()) {
|
||||
paintTitle(p, lang(lng_bot_choose_group));
|
||||
|
@ -1828,15 +1828,26 @@ StickerPanInner::InlineRow &StickerPanInner::layoutInlineRow(InlineRow &row, int
|
||||
int32 count = row.items.size();
|
||||
t_assert(count <= SavedGifsMaxPerRow);
|
||||
|
||||
// enumerate items in the order of growing maxWidth()
|
||||
// for that sort item indices by maxWidth()
|
||||
int indices[SavedGifsMaxPerRow];
|
||||
for (int i = 0; i < count; ++i) {
|
||||
indices[i] = i;
|
||||
}
|
||||
std::sort(indices, indices + count, [&row](int a, int b) -> bool {
|
||||
return row.items.at(a)->maxWidth() < row.items.at(b)->maxWidth();
|
||||
});
|
||||
|
||||
row.height = 0;
|
||||
int32 availw = width() - st::inlineResultsLeft - st::inlineResultsSkip * (count - 1);
|
||||
for (int32 i = 0; i < count; ++i) {
|
||||
int32 w = sumWidth ? (row.items.at(i)->maxWidth() * availw / sumWidth) : row.items.at(i)->maxWidth();
|
||||
int32 actualw = qMax(w, int32(st::inlineResultsMinWidth));
|
||||
row.height = qMax(row.height, row.items.at(i)->resizeGetHeight(actualw));
|
||||
int availw = width() - st::inlineResultsLeft - st::inlineResultsSkip * (count - 1);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
int index = indices[i];
|
||||
int w = sumWidth ? (row.items.at(index)->maxWidth() * availw / sumWidth) : row.items.at(index)->maxWidth();
|
||||
int actualw = qMax(w, int(st::inlineResultsMinWidth));
|
||||
row.height = qMax(row.height, row.items.at(index)->resizeGetHeight(actualw));
|
||||
if (sumWidth) {
|
||||
availw -= actualw;
|
||||
sumWidth -= row.items.at(i)->maxWidth();
|
||||
sumWidth -= row.items.at(index)->maxWidth();
|
||||
}
|
||||
}
|
||||
return row;
|
||||
|
@ -8021,6 +8021,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
|
||||
drawPinnedBar(p);
|
||||
}
|
||||
if (_scroll.isHidden()) {
|
||||
p.setClipRect(_scroll.geometry());
|
||||
QPoint dogPos((width() - st::msgDogImg.pxWidth()) / 2, ((height() - _field.height() - 2 * st::sendPadding - st::msgDogImg.pxHeight()) * 4) / 9);
|
||||
p.drawPixmap(dogPos, *cChatDogImage());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user