fix: sticker confirmation for media editor

This commit is contained in:
AlexeyZavar 2024-09-23 17:08:49 +03:00
parent 3d91d2c80a
commit 2b01b63ee1
3 changed files with 5 additions and 1 deletions

View file

@ -192,6 +192,7 @@ StickersListWidget::StickersListWidget(
descriptor.show,
descriptor.paused)
, _mode(descriptor.mode)
, _requireConfirmation(descriptor.requireConfirmation)
, _show(std::move(descriptor.show))
, _features(descriptor.features)
, _overBg(st::roundRadiusLarge, st().overBg)
@ -1917,7 +1918,7 @@ void StickersListWidget::mouseReleaseEvent(QMouseEvent *e) {
});
});
if (settings->stickerConfirmation) {
if (settings->stickerConfirmation && (_mode == Mode::Full || _mode == Mode::ChatIntro) && _requireConfirmation) {
Ui::show(Ui::MakeConfirmBox({
.text = tr::ayu_ConfirmationSticker(),
.confirmed = sendStickerCallback,

View file

@ -77,6 +77,7 @@ struct StickerCustomRecentDescriptor {
struct StickersListDescriptor {
std::shared_ptr<Show> show;
StickersListMode mode = StickersListMode::Full;
bool requireConfirmation = true;
Fn<bool()> paused;
std::vector<StickerCustomRecentDescriptor> customRecentList;
const style::EmojiPan *st = nullptr;
@ -373,6 +374,7 @@ private:
not_null<DocumentData*> document);
const Mode _mode;
bool _requireConfirmation;
const std::shared_ptr<Show> _show;
const ComposeFeatures _features;
Ui::RoundRect _overBg;

View file

@ -579,6 +579,7 @@ TabbedSelector::Tab TabbedSelector::createTab(SelectorTab type, int index) {
.mode = (_mode == Mode::ChatIntro
? StickersMode::ChatIntro
: StickersMode::Full),
.requireConfirmation = _mode != Mode::MediaEditor,
.paused = paused,
.st = &_st,
.features = _features,