mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: sticker confirmation for media editor
This commit is contained in:
parent
3d91d2c80a
commit
2b01b63ee1
3 changed files with 5 additions and 1 deletions
|
@ -192,6 +192,7 @@ StickersListWidget::StickersListWidget(
|
||||||
descriptor.show,
|
descriptor.show,
|
||||||
descriptor.paused)
|
descriptor.paused)
|
||||||
, _mode(descriptor.mode)
|
, _mode(descriptor.mode)
|
||||||
|
, _requireConfirmation(descriptor.requireConfirmation)
|
||||||
, _show(std::move(descriptor.show))
|
, _show(std::move(descriptor.show))
|
||||||
, _features(descriptor.features)
|
, _features(descriptor.features)
|
||||||
, _overBg(st::roundRadiusLarge, st().overBg)
|
, _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({
|
Ui::show(Ui::MakeConfirmBox({
|
||||||
.text = tr::ayu_ConfirmationSticker(),
|
.text = tr::ayu_ConfirmationSticker(),
|
||||||
.confirmed = sendStickerCallback,
|
.confirmed = sendStickerCallback,
|
||||||
|
|
|
@ -77,6 +77,7 @@ struct StickerCustomRecentDescriptor {
|
||||||
struct StickersListDescriptor {
|
struct StickersListDescriptor {
|
||||||
std::shared_ptr<Show> show;
|
std::shared_ptr<Show> show;
|
||||||
StickersListMode mode = StickersListMode::Full;
|
StickersListMode mode = StickersListMode::Full;
|
||||||
|
bool requireConfirmation = true;
|
||||||
Fn<bool()> paused;
|
Fn<bool()> paused;
|
||||||
std::vector<StickerCustomRecentDescriptor> customRecentList;
|
std::vector<StickerCustomRecentDescriptor> customRecentList;
|
||||||
const style::EmojiPan *st = nullptr;
|
const style::EmojiPan *st = nullptr;
|
||||||
|
@ -373,6 +374,7 @@ private:
|
||||||
not_null<DocumentData*> document);
|
not_null<DocumentData*> document);
|
||||||
|
|
||||||
const Mode _mode;
|
const Mode _mode;
|
||||||
|
bool _requireConfirmation;
|
||||||
const std::shared_ptr<Show> _show;
|
const std::shared_ptr<Show> _show;
|
||||||
const ComposeFeatures _features;
|
const ComposeFeatures _features;
|
||||||
Ui::RoundRect _overBg;
|
Ui::RoundRect _overBg;
|
||||||
|
|
|
@ -579,6 +579,7 @@ TabbedSelector::Tab TabbedSelector::createTab(SelectorTab type, int index) {
|
||||||
.mode = (_mode == Mode::ChatIntro
|
.mode = (_mode == Mode::ChatIntro
|
||||||
? StickersMode::ChatIntro
|
? StickersMode::ChatIntro
|
||||||
: StickersMode::Full),
|
: StickersMode::Full),
|
||||||
|
.requireConfirmation = _mode != Mode::MediaEditor,
|
||||||
.paused = paused,
|
.paused = paused,
|
||||||
.st = &_st,
|
.st = &_st,
|
||||||
.features = _features,
|
.features = _features,
|
||||||
|
|
Loading…
Add table
Reference in a new issue