Added label under shortcut strip in emoji/stickers list widgets.

This commit is contained in:
23rd
2026-04-27 12:29:59 +03:00
committed by John Preston
parent bf98379b91
commit 523e2185ee
3 changed files with 53 additions and 12 deletions
+1
View File
@@ -4483,6 +4483,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_custom_emoji_count#one" = "{count} emoji";
"lng_custom_emoji_count#other" = "{count} emoji";
"lng_search_back_to_results" = "Back to search";
"lng_search_results_header" = "Search Result";
"lng_stickers_attached_sets" = "Sets of attached stickers";
"lng_custom_emoji_used_sets" = "Sets of used emoji";
"lng_custom_emoji_remove_pack_button" = "Remove Emoji";
@@ -1265,12 +1265,18 @@ int EmojiListWidget::searchShortcutsTop() const {
}
int EmojiListWidget::searchShortcutsHeight() const {
return searchShortcutsShown()
? ((searchShortcutSelected() ? st().searchBackHeight : 0)
+ st().searchPacksTop
+ st().searchPackHeight
+ st().searchPacksBottom)
: 0;
if (!searchShortcutsShown()) {
return 0;
}
auto result = st().searchPacksTop
+ st().searchPackHeight
+ st().searchPacksBottom;
if (searchShortcutSelected()) {
result += st().searchBackHeight;
} else {
result += st().header;
}
return result;
}
QRect EmojiListWidget::searchBackRect() const {
@@ -2106,6 +2112,20 @@ void EmojiListWidget::paintSearchShortcuts(Painter &p, QRect clip) {
titleWidth);
}
p.restore();
if (!searchShortcutSelected()) {
const auto top = searchShortcutsTop()
+ st().searchPacksTop
+ st().searchPackHeight
+ st().searchPacksBottom;
p.setFont(st::emojiPanHeaderFont);
p.setPen(st().headerFg);
p.drawTextLeft(
st().headerLeft - st().margin.left(),
top + st().headerTop,
width(),
tr::lng_search_results_header(tr::now));
}
}
void EmojiListWidget::paintSearchShortcutIcon(
@@ -910,12 +910,18 @@ int StickersListWidget::searchShortcutsTop() const {
}
int StickersListWidget::searchShortcutsHeight() const {
return searchShortcutsShown()
? ((searchShortcutSelected() ? st().searchBackHeight : 0)
+ st().searchPacksTop
+ st().searchPackHeight
+ st().searchPacksBottom)
: 0;
if (!searchShortcutsShown()) {
return 0;
}
auto result = st().searchPacksTop
+ st().searchPackHeight
+ st().searchPacksBottom;
if (searchShortcutSelected()) {
result += st().searchBackHeight;
} else {
result += st().header;
}
return result;
}
QRect StickersListWidget::searchBackRect() const {
@@ -1389,6 +1395,20 @@ void StickersListWidget::paintSearchShortcuts(Painter &p, QRect clip) {
titleWidth);
}
p.restore();
if (!searchShortcutSelected()) {
const auto top = searchShortcutsTop()
+ st().searchPacksTop
+ st().searchPackHeight
+ st().searchPacksBottom;
p.setFont(st::emojiPanHeaderFont);
p.setPen(st().headerFg);
p.drawTextLeft(
st().headerLeft - st().margin.left(),
top + st().headerTop,
width(),
tr::lng_search_results_header(tr::now));
}
}
void StickersListWidget::paintSearchShortcutIcon(