mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Make 8 column emoji picker by default.
This commit is contained in:
parent
265bebb304
commit
18a6f7d700
9 changed files with 103 additions and 80 deletions
Binary file not shown.
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 774 B |
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -1791,6 +1791,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_switch_gifs" = "GIFs";
|
"lng_switch_gifs" = "GIFs";
|
||||||
"lng_switch_masks" = "Masks";
|
"lng_switch_masks" = "Masks";
|
||||||
"lng_stickers_featured_add" = "Add";
|
"lng_stickers_featured_add" = "Add";
|
||||||
|
"lng_emoji_featured_unlock" = "Unlock";
|
||||||
|
"lng_emoji_premium_restore" = "Restore";
|
||||||
"lng_gifs_search" = "Search GIFs";
|
"lng_gifs_search" = "Search GIFs";
|
||||||
"lng_gifs_no_saved" = "You have no saved GIFs yet.";
|
"lng_gifs_no_saved" = "You have no saved GIFs yet.";
|
||||||
|
|
||||||
|
@ -1825,6 +1827,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_custom_emoji_count#other" = "{count} emoji";
|
"lng_custom_emoji_count#other" = "{count} emoji";
|
||||||
"lng_stickers_attached_sets" = "Sets of attached stickers";
|
"lng_stickers_attached_sets" = "Sets of attached stickers";
|
||||||
"lng_custom_emoji_used_sets" = "Sets of used emoji";
|
"lng_custom_emoji_used_sets" = "Sets of used emoji";
|
||||||
|
"lng_custom_emoji_remove_pack_button" = "Remove Emoji";
|
||||||
"lng_stickers_group_set" = "Group sticker set";
|
"lng_stickers_group_set" = "Group sticker set";
|
||||||
"lng_stickers_remove_group_set" = "Remove group sticker set?";
|
"lng_stickers_remove_group_set" = "Remove group sticker set?";
|
||||||
"lng_stickers_group_from_your" = "Choose from your stickers";
|
"lng_stickers_group_from_your" = "Choose from your stickers";
|
||||||
|
@ -1833,8 +1836,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_stickers_nothing_found" = "No stickers found";
|
"lng_stickers_nothing_found" = "No stickers found";
|
||||||
"lng_stickers_remove_pack_confirm" = "Remove";
|
"lng_stickers_remove_pack_confirm" = "Remove";
|
||||||
"lng_stickers_archive_pack" = "Archive Stickers";
|
"lng_stickers_archive_pack" = "Archive Stickers";
|
||||||
|
"lng_stickers_remove_pack_button" = "Remove Stickers";
|
||||||
"lng_stickers_has_been_archived" = "Sticker pack has been archived.";
|
"lng_stickers_has_been_archived" = "Sticker pack has been archived.";
|
||||||
"lng_masks_archive_pack" = "Archive Masks";
|
"lng_masks_archive_pack" = "Archive Masks";
|
||||||
|
"lng_masks_remove_pack_button" = "Remove Masks";
|
||||||
"lng_masks_has_been_archived" = "Mask pack has been archived.";
|
"lng_masks_has_been_archived" = "Mask pack has been archived.";
|
||||||
"lng_masks_installed" = "Mask pack has been installed.";
|
"lng_masks_installed" = "Mask pack has been installed.";
|
||||||
|
|
||||||
|
|
|
@ -159,15 +159,22 @@ emojiPanShowDuration: 200;
|
||||||
emojiPanDuration: 200;
|
emojiPanDuration: 200;
|
||||||
emojiPanHover: windowBgOver;
|
emojiPanHover: windowBgOver;
|
||||||
emojiPanSlideDuration: 200;
|
emojiPanSlideDuration: 200;
|
||||||
emojiPanDesiredSize: 45px;
|
emojiPanDesiredSize: 39px;
|
||||||
|
emojiPanArea: size(34px, 32px);
|
||||||
|
emojiPanLeft: 13px;
|
||||||
|
emojiPanRight: 17px;
|
||||||
|
emojiPanRadius: 8px;
|
||||||
|
|
||||||
inlineResultsMinHeight: 278px;
|
inlineResultsMinHeight: 278px;
|
||||||
inlineResultsMaxHeight: 640px;
|
inlineResultsMaxHeight: 640px;
|
||||||
|
|
||||||
emojiPanHeader: 42px;
|
emojiPanHeader: 40px;
|
||||||
emojiPanHeaderFont: semiboldFont;
|
emojiPanHeaderFont: semiboldFont;
|
||||||
emojiPanHeaderLeft: 22px;
|
emojiPanHeaderLeft: 23px;
|
||||||
|
emojiPanHeaderLockLeft: 17px;
|
||||||
|
emojiPanHeaderLockedLeft: 36px;
|
||||||
emojiPanHeaderTop: 12px;
|
emojiPanHeaderTop: 12px;
|
||||||
|
emojiPanRemoveSkip: 10px;
|
||||||
|
|
||||||
emojiColorsPadding: 5px;
|
emojiColorsPadding: 5px;
|
||||||
emojiColorsSep: 1px;
|
emojiColorsSep: 1px;
|
||||||
|
|
|
@ -84,6 +84,8 @@ private:
|
||||||
int _pressedSel = -1;
|
int _pressedSel = -1;
|
||||||
QPoint _lastMousePos;
|
QPoint _lastMousePos;
|
||||||
QSize _singleSize;
|
QSize _singleSize;
|
||||||
|
QPoint _areaPosition;
|
||||||
|
QPoint _innerPosition;
|
||||||
|
|
||||||
bool _hiding = false;
|
bool _hiding = false;
|
||||||
QPixmap _cache;
|
QPixmap _cache;
|
||||||
|
@ -224,7 +226,15 @@ void EmojiColorPicker::handleMouseRelease(QPoint globalPos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiColorPicker::setSingleSize(QSize size) {
|
void EmojiColorPicker::setSingleSize(QSize size) {
|
||||||
|
const auto area = st::emojiPanArea;
|
||||||
_singleSize = size;
|
_singleSize = size;
|
||||||
|
_areaPosition = QPoint(
|
||||||
|
(_singleSize.width() - area.width()) / 2,
|
||||||
|
(_singleSize.height() - area.height()) / 2);
|
||||||
|
const auto esize = Ui::Emoji::GetSizeLarge() / style::DevicePixelRatio();
|
||||||
|
_innerPosition = QPoint(
|
||||||
|
(area.width() - esize) / 2,
|
||||||
|
(area.height() - esize) / 2);
|
||||||
updateSize();
|
updateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,19 +352,33 @@ void EmojiColorPicker::setSelected(int newSelected) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiColorPicker::drawVariant(Painter &p, int variant) {
|
void EmojiColorPicker::drawVariant(Painter &p, int variant) {
|
||||||
QPoint w(st::emojiPanMargins.left() + st::emojiColorsPadding + variant * _singleSize.width() + (variant ? 2 * st::emojiColorsPadding + st::emojiColorsSep : 0), st::emojiPanMargins.top() + st::emojiColorsPadding);
|
const auto w = QPoint(
|
||||||
|
st::emojiPanMargins.left(),
|
||||||
|
st::emojiPanMargins.top()
|
||||||
|
) + QPoint(
|
||||||
|
(st::emojiColorsPadding
|
||||||
|
+ variant * _singleSize.width()
|
||||||
|
+ (variant
|
||||||
|
? (2 * st::emojiColorsPadding + st::emojiColorsSep)
|
||||||
|
: 0)),
|
||||||
|
st::emojiColorsPadding
|
||||||
|
) + _areaPosition;
|
||||||
if (variant == _selected) {
|
if (variant == _selected) {
|
||||||
QPoint tl(w);
|
QPoint tl(w);
|
||||||
if (rtl()) tl.setX(width() - tl.x() - _singleSize.width());
|
if (rtl()) tl.setX(width() - tl.x() - st::emojiPanArea.width());
|
||||||
Ui::FillRoundRect(p, QRect(tl, _singleSize), st::emojiPanHover, Ui::StickerHoverCorners);
|
|
||||||
|
Ui::FillRoundRect(
|
||||||
|
p,
|
||||||
|
QRect(tl, st::emojiPanArea),
|
||||||
|
st::emojiPanHover,
|
||||||
|
Ui::EmojiHoverCorners);
|
||||||
}
|
}
|
||||||
const auto esize = Ui::Emoji::GetSizeLarge();
|
|
||||||
Ui::Emoji::Draw(
|
Ui::Emoji::Draw(
|
||||||
p,
|
p,
|
||||||
_variants[variant],
|
_variants[variant],
|
||||||
esize,
|
Ui::Emoji::GetSizeLarge(),
|
||||||
w.x() + (_singleSize.width() - (esize / cIntRetinaFactor())) / 2,
|
w.x() + _innerPosition.x(),
|
||||||
w.y() + (_singleSize.height() - (esize / cIntRetinaFactor())) / 2);
|
w.y() + _innerPosition.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
EmojiListWidget::EmojiListWidget(
|
EmojiListWidget::EmojiListWidget(
|
||||||
|
@ -369,8 +393,6 @@ EmojiListWidget::EmojiListWidget(
|
||||||
|
|
||||||
_picker->hide();
|
_picker->hide();
|
||||||
|
|
||||||
_esize = Ui::Emoji::GetSizeLarge();
|
|
||||||
|
|
||||||
for (auto i = 1; i != kEmojiSectionCount; ++i) {
|
for (auto i = 1; i != kEmojiSectionCount; ++i) {
|
||||||
const auto section = static_cast<Section>(i);
|
const auto section = static_cast<Section>(i);
|
||||||
_counts[i] = Ui::Emoji::GetSectionCount(section);
|
_counts[i] = Ui::Emoji::GetSectionCount(section);
|
||||||
|
@ -563,13 +585,10 @@ bool EmojiListWidget::enumerateSections(Callback callback) const {
|
||||||
const auto premiumMayBeBought = !session->premium()
|
const auto premiumMayBeBought = !session->premium()
|
||||||
&& session->premiumPossible();
|
&& session->premiumPossible();
|
||||||
const auto next = [&] {
|
const auto next = [&] {
|
||||||
const auto shift = (info.premiumRequired ? st::emojiPanPadding : 0);
|
|
||||||
info.rowsCount = (info.count + _columnCount - 1) / _columnCount;
|
info.rowsCount = (info.count + _columnCount - 1) / _columnCount;
|
||||||
info.rowsTop = info.top
|
info.rowsTop = info.top
|
||||||
+ (i == 0 ? st::emojiPanPadding : st::emojiPanHeader)
|
+ (i == 0 ? st::emojiPanPadding : st::emojiPanHeader);
|
||||||
- shift;
|
|
||||||
info.rowsBottom = info.rowsTop
|
info.rowsBottom = info.rowsTop
|
||||||
+ shift
|
|
||||||
+ (info.rowsCount * _singleSize.height())
|
+ (info.rowsCount * _singleSize.height())
|
||||||
+ st::roundRadiusSmall;
|
+ st::roundRadiusSmall;
|
||||||
if (!callback(info)) {
|
if (!callback(info)) {
|
||||||
|
@ -628,21 +647,32 @@ int EmojiListWidget::sectionsCount() const {
|
||||||
return kEmojiSectionCount + int(_custom.size());
|
return kEmojiSectionCount + int(_custom.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EmojiListWidget::setSingleSize(QSize size) {
|
||||||
|
const auto area = st::emojiPanArea;
|
||||||
|
_singleSize = size;
|
||||||
|
_areaPosition = QPoint(
|
||||||
|
(_singleSize.width() - area.width()) / 2,
|
||||||
|
(_singleSize.height() - area.height()) / 2);
|
||||||
|
const auto esize = Ui::Emoji::GetSizeLarge() / style::DevicePixelRatio();
|
||||||
|
_innerPosition = QPoint(
|
||||||
|
(area.width() - esize) / 2,
|
||||||
|
(area.height() - esize) / 2);
|
||||||
|
_picker->setSingleSize(_singleSize);
|
||||||
|
}
|
||||||
|
|
||||||
int EmojiListWidget::countDesiredHeight(int newWidth) {
|
int EmojiListWidget::countDesiredHeight(int newWidth) {
|
||||||
|
const auto left = st::emojiPanLeft;
|
||||||
|
const auto right = st::emojiPanRight;
|
||||||
const auto fullWidth = st::roundRadiusSmall
|
const auto fullWidth = st::roundRadiusSmall
|
||||||
+ newWidth
|
+ newWidth
|
||||||
+ st::emojiScroll.width;
|
+ st::emojiScroll.width;
|
||||||
_columnCount = std::max(
|
const auto innerWidth = fullWidth - left - right;
|
||||||
(fullWidth - st::emojiPadding * 2) / st::emojiPanDesiredSize,
|
_columnCount = std::max(innerWidth / st::emojiPanDesiredSize, 1);
|
||||||
1);
|
const auto singleWidth = innerWidth / _columnCount;
|
||||||
|
_rowsLeft = left
|
||||||
_rowsLeft = fullWidth / (_columnCount * 4 + 2);
|
+ (innerWidth - _columnCount * singleWidth) / 2
|
||||||
auto rowsRight = std::max(_rowsLeft, st::emojiScroll.width);
|
- st::roundRadiusSmall;
|
||||||
auto singleWidth = (fullWidth - _rowsLeft - rowsRight)
|
setSingleSize({ singleWidth, singleWidth - 4 * st::lineWidth });
|
||||||
/ _columnCount;
|
|
||||||
_rowsLeft -= st::roundRadiusSmall;
|
|
||||||
_singleSize = QSize(singleWidth, singleWidth - 4 * st::lineWidth);
|
|
||||||
_picker->setSingleSize(_singleSize);
|
|
||||||
|
|
||||||
auto visibleHeight = minimalHeight();
|
auto visibleHeight = minimalHeight();
|
||||||
auto minimalHeight = (visibleHeight - st::stickerPanPadding);
|
auto minimalHeight = (visibleHeight - st::stickerPanPadding);
|
||||||
|
@ -734,17 +764,12 @@ void EmojiListWidget::paintEvent(QPaintEvent *e) {
|
||||||
} else if (r.top() + r.height() <= info.top) {
|
} else if (r.top() + r.height() <= info.top) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (info.premiumRequired) {
|
|
||||||
drawPremiumRect(p, info);
|
|
||||||
}
|
|
||||||
auto widthForTitle = emojiRight() - (st::emojiPanHeaderLeft - st::roundRadiusSmall);
|
auto widthForTitle = emojiRight() - (st::emojiPanHeaderLeft - st::roundRadiusSmall);
|
||||||
const auto skip = st::roundRadiusSmall;
|
const auto skip = st::roundRadiusSmall;
|
||||||
if (hasRemoveButton(info.section)) {
|
if (hasRemoveButton(info.section)) {
|
||||||
auto &custom = _custom[info.section - kEmojiSectionCount];
|
auto &custom = _custom[info.section - kEmojiSectionCount];
|
||||||
auto remove = removeButtonRect(info.section);
|
auto remove = removeButtonRect(info.section);
|
||||||
auto expanded = remove.marginsAdded({ skip, 0, skip, 0 });
|
if (remove.intersects(r)) {
|
||||||
if (expanded.intersects(r)) {
|
|
||||||
p.fillRect(expanded, st::emojiPanBg);
|
|
||||||
auto selected = selectedButton ? (selectedButton->section == info.section) : false;
|
auto selected = selectedButton ? (selectedButton->section == info.section) : false;
|
||||||
if (custom.ripple) {
|
if (custom.ripple) {
|
||||||
custom.ripple->paint(p, remove.x() + st::stickerPanRemoveSet.rippleAreaPosition.x(), remove.y() + st::stickerPanRemoveSet.rippleAreaPosition.y(), width());
|
custom.ripple->paint(p, remove.x() + st::stickerPanRemoveSet.rippleAreaPosition.x(), remove.y() + st::stickerPanRemoveSet.rippleAreaPosition.y(), width());
|
||||||
|
@ -767,17 +792,16 @@ void EmojiListWidget::paintEvent(QPaintEvent *e) {
|
||||||
titleText = st::emojiPanHeaderFont->elided(titleText, widthForTitle);
|
titleText = st::emojiPanHeaderFont->elided(titleText, widthForTitle);
|
||||||
titleWidth = st::emojiPanHeaderFont->width(titleText);
|
titleWidth = st::emojiPanHeaderFont->width(titleText);
|
||||||
}
|
}
|
||||||
auto left = st::emojiPanHeaderLeft - st::roundRadiusSmall;
|
const auto left = (info.premiumRequired
|
||||||
|
? st::emojiPanHeaderLockedLeft
|
||||||
|
: st::emojiPanHeaderLeft) - st::roundRadiusSmall;
|
||||||
const auto top = info.top + st::emojiPanHeaderTop;
|
const auto top = info.top + st::emojiPanHeaderTop;
|
||||||
if (info.premiumRequired) {
|
if (info.premiumRequired) {
|
||||||
p.fillRect(
|
st::emojiPremiumRequired.paint(
|
||||||
left - skip,
|
p,
|
||||||
top - skip,
|
st::emojiPanHeaderLockLeft - st::roundRadiusSmall,
|
||||||
titleWidth + st::emojiPremiumRequired.width() + skip,
|
top,
|
||||||
st::emojiPanHeaderFont->height + 2 * skip,
|
width());
|
||||||
st::emojiPanBg);
|
|
||||||
st::emojiPremiumRequired.paint(p, left - skip, top, width());
|
|
||||||
left += st::emojiPremiumRequired.width() - skip;
|
|
||||||
}
|
}
|
||||||
p.setFont(st::emojiPanHeaderFont);
|
p.setFont(st::emojiPanHeaderFont);
|
||||||
p.setPen(st::emojiPanHeaderFg);
|
p.setPen(st::emojiPanHeaderFg);
|
||||||
|
@ -800,11 +824,18 @@ void EmojiListWidget::paintEvent(QPaintEvent *e) {
|
||||||
|| (!_picker->isHidden()
|
|| (!_picker->isHidden()
|
||||||
&& state == _pickerSelected);
|
&& state == _pickerSelected);
|
||||||
|
|
||||||
auto w = QPoint(_rowsLeft + j * _singleSize.width(), info.rowsTop + i * _singleSize.height());
|
auto w = QPoint(
|
||||||
|
_rowsLeft + j * _singleSize.width(),
|
||||||
|
info.rowsTop + i * _singleSize.height()
|
||||||
|
) + _areaPosition;
|
||||||
if (selected && !info.premiumRequired) {
|
if (selected && !info.premiumRequired) {
|
||||||
auto tl = w;
|
auto tl = w;
|
||||||
if (rtl()) tl.setX(width() - tl.x() - _singleSize.width());
|
if (rtl()) tl.setX(width() - tl.x() - st::emojiPanArea.width());
|
||||||
Ui::FillRoundRect(p, QRect(tl, _singleSize), st::emojiPanHover, Ui::StickerHoverCorners);
|
Ui::FillRoundRect(
|
||||||
|
p,
|
||||||
|
QRect(tl, st::emojiPanArea),
|
||||||
|
st::emojiPanHover,
|
||||||
|
Ui::EmojiHoverCorners);
|
||||||
}
|
}
|
||||||
if (info.section == int(Section::Recent)) {
|
if (info.section == int(Section::Recent)) {
|
||||||
drawRecent(p, w, now, paused, index);
|
drawRecent(p, w, now, paused, index);
|
||||||
|
@ -821,41 +852,22 @@ void EmojiListWidget::paintEvent(QPaintEvent *e) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiListWidget::drawPremiumRect(QPainter &p, const SectionInfo &info) {
|
|
||||||
auto pen = st::windowSubTextFg->p;
|
|
||||||
pen.setWidthF(style::ConvertScale(2.));
|
|
||||||
pen.setDashPattern({ 3, 5 });
|
|
||||||
pen.setDashOffset(2);
|
|
||||||
pen.setCapStyle(Qt::RoundCap);
|
|
||||||
p.setPen(pen);
|
|
||||||
p.setBrush(Qt::NoBrush);
|
|
||||||
|
|
||||||
const auto radius = st::roundRadiusLarge;
|
|
||||||
const auto titleTop = info.top + st::emojiPanHeaderTop;
|
|
||||||
const auto left = _rowsLeft;
|
|
||||||
const auto top = titleTop + st::emojiPanHeaderFont->height / 2;
|
|
||||||
const auto width = _columnCount * _singleSize.width();
|
|
||||||
const auto height = info.rowsBottom - top - st::roundRadiusSmall;
|
|
||||||
p.drawRoundedRect(left, top, width, height, radius, radius);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmojiListWidget::drawRecent(
|
void EmojiListWidget::drawRecent(
|
||||||
QPainter &p,
|
QPainter &p,
|
||||||
QPoint position,
|
QPoint position,
|
||||||
crl::time now,
|
crl::time now,
|
||||||
bool paused,
|
bool paused,
|
||||||
int index) {
|
int index) {
|
||||||
const auto size = (_esize / cIntRetinaFactor());
|
|
||||||
_recentPainted = true;
|
_recentPainted = true;
|
||||||
if (const auto emoji = std::get_if<EmojiPtr>(&_recent[index].id.data)) {
|
if (const auto emoji = std::get_if<EmojiPtr>(&_recent[index].id.data)) {
|
||||||
drawEmoji(p, position, *emoji);
|
drawEmoji(p, position, *emoji);
|
||||||
} else {
|
} else {
|
||||||
Assert(_recent[index].instance != nullptr);
|
Assert(_recent[index].instance != nullptr);
|
||||||
|
position += _innerPosition;
|
||||||
_recent[index].instance->object.paint(
|
_recent[index].instance->object.paint(
|
||||||
p,
|
p,
|
||||||
position.x() + (_singleSize.width() - size) / 2,
|
position.x(),
|
||||||
position.y() + (_singleSize.height() - size) / 2,
|
position.y(),
|
||||||
now,
|
now,
|
||||||
st::windowBgRipple->c,
|
st::windowBgRipple->c,
|
||||||
paused);
|
paused);
|
||||||
|
@ -866,13 +878,13 @@ void EmojiListWidget::drawEmoji(
|
||||||
QPainter &p,
|
QPainter &p,
|
||||||
QPoint position,
|
QPoint position,
|
||||||
EmojiPtr emoji) {
|
EmojiPtr emoji) {
|
||||||
const auto size = (_esize / cIntRetinaFactor());
|
position += _innerPosition;
|
||||||
Ui::Emoji::Draw(
|
Ui::Emoji::Draw(
|
||||||
p,
|
p,
|
||||||
emoji,
|
emoji,
|
||||||
_esize,
|
Ui::Emoji::GetSizeLarge(),
|
||||||
position.x() + (_singleSize.width() - size) / 2,
|
position.x(),
|
||||||
position.y() + (_singleSize.height() - size) / 2);
|
position.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmojiListWidget::drawCustom(
|
void EmojiListWidget::drawCustom(
|
||||||
|
@ -882,12 +894,12 @@ void EmojiListWidget::drawCustom(
|
||||||
bool paused,
|
bool paused,
|
||||||
int set,
|
int set,
|
||||||
int index) {
|
int index) {
|
||||||
const auto size = (_esize / cIntRetinaFactor());
|
position += _innerPosition;
|
||||||
_custom[set].painted = true;
|
_custom[set].painted = true;
|
||||||
_custom[set].list[index].instance->object.paint(
|
_custom[set].list[index].instance->object.paint(
|
||||||
p,
|
p,
|
||||||
position.x() + (_singleSize.width() - size) / 2,
|
position.x(),
|
||||||
position.y() + (_singleSize.height() - size) / 2,
|
position.y(),
|
||||||
now,
|
now,
|
||||||
st::windowBgRipple->c,
|
st::windowBgRipple->c,
|
||||||
paused);
|
paused);
|
||||||
|
@ -1085,7 +1097,7 @@ QRect EmojiListWidget::removeButtonRect(int index) const {
|
||||||
auto buttonw = st::stickerPanRemoveSet.rippleAreaPosition.x()
|
auto buttonw = st::stickerPanRemoveSet.rippleAreaPosition.x()
|
||||||
+ st::stickerPanRemoveSet.rippleAreaSize;
|
+ st::stickerPanRemoveSet.rippleAreaSize;
|
||||||
auto buttonh = st::stickerPanRemoveSet.height;
|
auto buttonh = st::stickerPanRemoveSet.height;
|
||||||
auto buttonx = emojiRight() - buttonw;
|
auto buttonx = emojiRight() - st::emojiPanRemoveSkip - buttonw;
|
||||||
auto buttony = sectionInfo(index).top + (st::emojiPanHeader - buttonh) / 2;
|
auto buttony = sectionInfo(index).top + (st::emojiPanHeader - buttonh) / 2;
|
||||||
return QRect(buttonx, buttony, buttonw, buttonh);
|
return QRect(buttonx, buttony, buttonw, buttonh);
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,6 +171,7 @@ private:
|
||||||
[[nodiscard]] SectionInfo sectionInfo(int section) const;
|
[[nodiscard]] SectionInfo sectionInfo(int section) const;
|
||||||
[[nodiscard]] SectionInfo sectionInfoByOffset(int yOffset) const;
|
[[nodiscard]] SectionInfo sectionInfoByOffset(int yOffset) const;
|
||||||
[[nodiscard]] int sectionsCount() const;
|
[[nodiscard]] int sectionsCount() const;
|
||||||
|
void setSingleSize(QSize size);
|
||||||
|
|
||||||
void showPicker();
|
void showPicker();
|
||||||
void pickerHidden();
|
void pickerHidden();
|
||||||
|
@ -204,7 +205,6 @@ private:
|
||||||
bool paused,
|
bool paused,
|
||||||
int set,
|
int set,
|
||||||
int index);
|
int index);
|
||||||
void drawPremiumRect(QPainter &p, const SectionInfo &info);
|
|
||||||
[[nodiscard]] bool hasRemoveButton(int index) const;
|
[[nodiscard]] bool hasRemoveButton(int index) const;
|
||||||
[[nodiscard]] QRect removeButtonRect(int index) const;
|
[[nodiscard]] QRect removeButtonRect(int index) const;
|
||||||
[[nodiscard]] QRect emojiRect(int section, int index) const;
|
[[nodiscard]] QRect emojiRect(int section, int index) const;
|
||||||
|
@ -255,7 +255,8 @@ private:
|
||||||
int _rowsLeft = 0;
|
int _rowsLeft = 0;
|
||||||
int _columnCount = 1;
|
int _columnCount = 1;
|
||||||
QSize _singleSize;
|
QSize _singleSize;
|
||||||
int _esize = 0;
|
QPoint _areaPosition;
|
||||||
|
QPoint _innerPosition;
|
||||||
|
|
||||||
OverState _selected;
|
OverState _selected;
|
||||||
OverState _pressed;
|
OverState _pressed;
|
||||||
|
|
|
@ -1009,8 +1009,6 @@ void Settings::resetOnLastLogout() {
|
||||||
_recentEmoji.clear();
|
_recentEmoji.clear();
|
||||||
_emojiVariants.clear();
|
_emojiVariants.clear();
|
||||||
|
|
||||||
_workMode = WorkMode::WindowAndTray;
|
|
||||||
|
|
||||||
_accountsOrder.clear();
|
_accountsOrder.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ void CreatePaletteCorners() {
|
||||||
PrepareCorners(OverviewVideoSelectedCorners, st::overviewVideoStatusRadius, st::msgDateImgBgSelected);
|
PrepareCorners(OverviewVideoSelectedCorners, st::overviewVideoStatusRadius, st::msgDateImgBgSelected);
|
||||||
PrepareCorners(ForwardCorners, st::historyMessageRadius, st::historyForwardChooseBg);
|
PrepareCorners(ForwardCorners, st::historyMessageRadius, st::historyForwardChooseBg);
|
||||||
PrepareCorners(MediaviewSaveCorners, st::mediaviewControllerRadius, st::mediaviewSaveMsgBg);
|
PrepareCorners(MediaviewSaveCorners, st::mediaviewControllerRadius, st::mediaviewSaveMsgBg);
|
||||||
PrepareCorners(EmojiHoverCorners, st::roundRadiusSmall, st::emojiPanHover);
|
PrepareCorners(EmojiHoverCorners, st::emojiPanRadius, st::emojiPanHover);
|
||||||
PrepareCorners(StickerHoverCorners, st::roundRadiusSmall, st::emojiPanHover);
|
PrepareCorners(StickerHoverCorners, st::roundRadiusSmall, st::emojiPanHover);
|
||||||
PrepareCorners(BotKeyboardCorners, st::roundRadiusSmall, st::botKbBg);
|
PrepareCorners(BotKeyboardCorners, st::roundRadiusSmall, st::botKbBg);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue