mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-09 13:13:52 +00:00
Improve send sticker from set box logic.
This commit is contained in:
@@ -189,12 +189,7 @@ void Widget::saveChanges(FnMut<void()> done) {
|
||||
}
|
||||
|
||||
SendMenu::Details Widget::sendMenuDetails() const {
|
||||
if (const auto provider
|
||||
= dynamic_cast<const ::Settings::SendMenuDetailsProvider*>(
|
||||
_inner.get())) {
|
||||
return provider->sendMenuDetails();
|
||||
}
|
||||
return ContentWidget::sendMenuDetails();
|
||||
return _inner->sendMenuDetails();
|
||||
}
|
||||
|
||||
bool Widget::processChosenSticker(ChatHelpers::FileChosen &&chosen) {
|
||||
|
||||
@@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#include "api/api_common.h"
|
||||
#include "menu/menu_send_details.h"
|
||||
|
||||
namespace style {
|
||||
struct ComposeIcons;
|
||||
@@ -30,45 +31,6 @@ class Thread;
|
||||
|
||||
namespace SendMenu {
|
||||
|
||||
enum class Type : uchar {
|
||||
Disabled,
|
||||
SilentOnly,
|
||||
Scheduled,
|
||||
ScheduledToUser, // For "Send when online".
|
||||
Reminder,
|
||||
EditCommentPrice,
|
||||
};
|
||||
|
||||
enum class SpoilerState : uchar {
|
||||
None,
|
||||
Enabled,
|
||||
Possible,
|
||||
};
|
||||
|
||||
enum class CaptionState : uchar {
|
||||
None,
|
||||
Below,
|
||||
Above,
|
||||
};
|
||||
|
||||
enum class PhotoQualityState : uchar {
|
||||
None,
|
||||
Standard,
|
||||
High,
|
||||
};
|
||||
|
||||
struct Details {
|
||||
Type type = Type::Disabled;
|
||||
SpoilerState spoiler = SpoilerState::None;
|
||||
CaptionState caption = CaptionState::None;
|
||||
PhotoQualityState photoQuality = PhotoQualityState::None;
|
||||
TextWithTags commentPreview;
|
||||
QString commentStreamerName;
|
||||
std::optional<uint64> price;
|
||||
std::optional<uint64> commentPriceMin;
|
||||
bool effectAllowed = false;
|
||||
};
|
||||
|
||||
enum class FillMenuResult : uchar {
|
||||
Prepared,
|
||||
Skipped,
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ui/text/text_entity.h"
|
||||
|
||||
namespace SendMenu {
|
||||
|
||||
enum class Type : uchar {
|
||||
Disabled,
|
||||
SilentOnly,
|
||||
Scheduled,
|
||||
ScheduledToUser, // For "Send when online".
|
||||
Reminder,
|
||||
EditCommentPrice,
|
||||
};
|
||||
|
||||
enum class SpoilerState : uchar {
|
||||
None,
|
||||
Enabled,
|
||||
Possible,
|
||||
};
|
||||
|
||||
enum class CaptionState : uchar {
|
||||
None,
|
||||
Below,
|
||||
Above,
|
||||
};
|
||||
|
||||
enum class PhotoQualityState : uchar {
|
||||
None,
|
||||
Standard,
|
||||
High,
|
||||
};
|
||||
|
||||
struct Details {
|
||||
Type type = Type::Disabled;
|
||||
SpoilerState spoiler = SpoilerState::None;
|
||||
CaptionState caption = CaptionState::None;
|
||||
PhotoQualityState photoQuality = PhotoQualityState::None;
|
||||
TextWithTags commentPreview;
|
||||
QString commentStreamerName;
|
||||
std::optional<uint64> price;
|
||||
std::optional<uint64> commentPriceMin;
|
||||
bool effectAllowed = false;
|
||||
};
|
||||
|
||||
} // namespace SendMenu
|
||||
@@ -74,7 +74,6 @@ using namespace HistoryView;
|
||||
|
||||
class ShortcutMessages
|
||||
: public AbstractSection
|
||||
, public SendMenuDetailsProvider
|
||||
, private WindowListDelegate
|
||||
, private CornerButtonsDelegate {
|
||||
public:
|
||||
@@ -94,7 +93,6 @@ public:
|
||||
|
||||
[[nodiscard]] rpl::producer<QString> title() override;
|
||||
[[nodiscard]] rpl::producer<> sectionShowBack() override;
|
||||
[[nodiscard]] SendMenu::Details sendMenuDetails() const override;
|
||||
bool processChosenSticker(ChatHelpers::FileChosen &&chosen) override;
|
||||
void setInnerFocus() override;
|
||||
|
||||
@@ -1450,10 +1448,6 @@ void ShortcutMessages::finishSending() {
|
||||
showAtEnd();
|
||||
}
|
||||
|
||||
SendMenu::Details ShortcutMessages::sendMenuDetails() const {
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ShortcutMessages::processChosenSticker(ChatHelpers::FileChosen &&chosen) {
|
||||
if (!_composeControls) {
|
||||
return false;
|
||||
|
||||
@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "base/timer.h"
|
||||
#include "lottie/lottie_icon.h"
|
||||
#include "menu/menu_send_details.h"
|
||||
#include "ui/effects/animations.h"
|
||||
#include "ui/effects/premium_graphics.h"
|
||||
#include "ui/effects/premium_top_bar.h"
|
||||
@@ -296,6 +297,10 @@ AbstractSection::AbstractSection(
|
||||
: _controller(controller) {
|
||||
}
|
||||
|
||||
SendMenu::Details AbstractSection::sendMenuDetails() const {
|
||||
return {};
|
||||
}
|
||||
|
||||
bool AbstractSection::processChosenSticker(ChatHelpers::FileChosen &&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ public:
|
||||
virtual void sectionSaveChanges(FnMut<void()> done) {
|
||||
done();
|
||||
}
|
||||
virtual SendMenu::Details sendMenuDetails() const;
|
||||
virtual bool processChosenSticker(ChatHelpers::FileChosen &&chosen);
|
||||
virtual void showFinished() {
|
||||
_showFinished.fire({});
|
||||
@@ -204,14 +205,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
class SendMenuDetailsProvider {
|
||||
public:
|
||||
[[nodiscard]] virtual SendMenu::Details sendMenuDetails() const = 0;
|
||||
|
||||
virtual ~SendMenuDetailsProvider() = default;
|
||||
|
||||
};
|
||||
|
||||
enum class IconType {
|
||||
Rounded,
|
||||
Round,
|
||||
|
||||
@@ -231,6 +231,7 @@ PRIVATE
|
||||
menu/menu_check_item.h
|
||||
menu/menu_item_rate_transcribe.cpp
|
||||
menu/menu_item_rate_transcribe.h
|
||||
menu/menu_send_details.h
|
||||
menu/menu_timecode_action.cpp
|
||||
menu/menu_timecode_action.h
|
||||
menu/menu_ttl.cpp
|
||||
|
||||
Reference in New Issue
Block a user