Fixed emoji packs menu item.

This commit is contained in:
John Preston 2022-08-18 18:09:57 +03:00
parent 8d2ebdbb99
commit b648387e96
2 changed files with 3 additions and 3 deletions

View file

@ -1333,7 +1333,7 @@ void AddEmojiPacksAction(
menu->addSeparator();
}
auto button = base::make_unique_q<Item>(
menu,
menu->menu(),
menu->st().menu,
(name.text.isEmpty()
? tr::lng_context_animated_emoji_many(

View file

@ -138,7 +138,7 @@ int PopupSelector::countWidth(int desiredWidth, int maxWidth) {
int(_reactions.recent.size()) + (added ? 1 : 0));
_small = (possibleColumns - _columns > 1);
_recentRows = (_reactions.recent.size() + _columns - 1) / _columns;
return 2 * _skipx + _columns * _size;
return std::max(2 * _skipx + _columns * _size, desiredWidth);
}
QMargins PopupSelector::extentsForShadow() const {
@ -291,7 +291,7 @@ bool AdjustMenuGeometryForSelector(
not_null<PopupSelector*> selector) {
const auto extend = st::reactStripExtend;
const auto added = extend.left() + extend.right();
const auto desiredWidth = menu->width() + added;
const auto desiredWidth = menu->menu()->width() + added;
const auto maxWidth = menu->st().menu.widthMax + added;
const auto width = selector->countWidth(desiredWidth, maxWidth);
const auto extents = selector->extentsForShadow();