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:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user