2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix layout with a single available reaction.

This commit is contained in:
John Preston
2022-08-23 18:09:40 +03:00
parent 0277d765bb
commit 4762c7a4fd
5 changed files with 24 additions and 7 deletions

View File

@@ -327,6 +327,7 @@ stickersPremiumLock: icon{{ "emoji/premium_lock", premiumButtonFg }};
reactStripExtend: margins(21px, 49px, 39px, 0px);
reactStripHeight: 40px;
reactStripSize: 32px;
reactStripMinWidth: 60px;
reactStripImage: 26px;
reactStripSkip: 7px;
reactStripBubble: icon{

View File

@@ -397,6 +397,10 @@ EmojiListWidget::EmojiListWidget(
setMouseTracking(true);
setAttribute(Qt::WA_OpaquePaintEvent);
_customSingleSize = Data::FrameSizeFromTag(
Data::CustomEmojiManager::SizeTag::Large
) / style::DevicePixelRatio();
_picker->hide();
for (auto i = 1; i != _staticCount; ++i) {
@@ -962,6 +966,7 @@ void EmojiListWidget::drawRecent(
position += _innerPosition + _customPosition;
_recent[index].custom->paint(p, {
.preview = st::windowBgRipple->c,
.size = QSize(_customSingleSize, _customSingleSize),
.now = now,
.scale = context.progress,
.position = position,
@@ -997,6 +1002,7 @@ void EmojiListWidget::drawCustom(
_custom[set].painted = true;
_custom[set].list[index].custom->paint(p, {
.preview = st::windowBgRipple->c,
.size = QSize(_customSingleSize, _customSingleSize),
.now = now,
.scale = context.progress,
.position = position,
@@ -1619,9 +1625,7 @@ std::vector<StickerIcon> EmojiListWidget::fillIcons() {
} else {
result.emplace_back(AllEmojiSectionSetId());
}
const auto esize = Data::FrameSizeFromTag(
Data::CustomEmojiManager::SizeTag::Large
) / style::DevicePixelRatio();
const auto esize = _customSingleSize;
for (const auto &custom : _custom) {
const auto set = custom.set;
result.emplace_back(set, custom.thumbnailDocument, esize, esize);

View File

@@ -329,6 +329,7 @@ private:
QVector<EmojiPtr> _emoji[kEmojiSectionCount];
std::vector<CustomSet> _custom;
base::flat_map<DocumentId, CustomEmojiInstance> _customEmoji;
int _customSingleSize = 0;
bool _allowWithoutPremium = false;
Ui::RoundRect _overBg;