2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix send menus with additional items.

This commit is contained in:
John Preston
2024-10-11 18:19:40 +04:00
parent ba31756bf9
commit 5767cbd0e3
6 changed files with 122 additions and 54 deletions

View File

@@ -402,9 +402,13 @@ base::unique_qptr<Ui::PopupMenu> GifsListWidget::fillContextMenu(
// inline results don't have effects
copyDetails.effectAllowed = false;
}
// In case we're adding items after FillSendMenu we have
// to pass nullptr for showForEffect and attach selector later.
// Otherwise added items widths won't be respected in menu geometry.
SendMenu::FillSendMenu(
menu,
_show,
nullptr, // showForMenu
copyDetails,
SendMenu::DefaultCallback(_show, send),
icons);
@@ -441,6 +445,13 @@ base::unique_qptr<Ui::PopupMenu> GifsListWidget::fillContextMenu(
AddGifAction(std::move(callback), _show, document, icons);
}
}
SendMenu::AttachSendMenuEffect(
menu,
_show,
copyDetails,
SendMenu::DefaultCallback(_show, send));
return menu;
}

View File

@@ -1780,9 +1780,13 @@ base::unique_qptr<Ui::PopupMenu> StickersListWidget::fillContextMenu(
});
});
const auto icons = &st().icons;
// In case we're adding items after FillSendMenu we have
// to pass nullptr for showForEffect and attach selector later.
// Otherwise added items widths won't be respected in menu geometry.
SendMenu::FillSendMenu(
menu,
_show,
nullptr, // showForEffect
details,
SendMenu::DefaultCallback(_show, send),
icons);
@@ -1816,6 +1820,13 @@ base::unique_qptr<Ui::PopupMenu> StickersListWidget::fillContextMenu(
false);
}, &icons->menuRecentRemove);
}
SendMenu::AttachSendMenuEffect(
menu,
_show,
details,
SendMenu::DefaultCallback(_show, send));
return menu;
}