mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Applied search categories to emoji userpic builder.
This commit is contained in:
parent
fda49a3bfa
commit
70cda17dea
5 changed files with 13 additions and 6 deletions
|
@ -471,7 +471,7 @@ void EmojiListWidget::setupSearch() {
|
|||
InvokeQueued(this, [=] {
|
||||
applyNextSearchQuery();
|
||||
});
|
||||
}, session, (_mode == Mode::EmojiStatus));
|
||||
}, session, (_mode == Mode::EmojiStatus), _mode == Mode::UserpicBuilder);
|
||||
}
|
||||
|
||||
void EmojiListWidget::applyNextSearchQuery() {
|
||||
|
@ -720,7 +720,8 @@ object_ptr<TabbedSelector::InnerFooter> EmojiListWidget::createFooter() {
|
|||
|
||||
void EmojiListWidget::afterShown() {
|
||||
const auto steal = (_mode == Mode::EmojiStatus)
|
||||
|| (_mode == Mode::FullReactions);
|
||||
|| (_mode == Mode::FullReactions)
|
||||
|| (_mode == Mode::UserpicBuilder);
|
||||
if (_search && steal) {
|
||||
_search->stealFocus();
|
||||
}
|
||||
|
@ -1411,6 +1412,7 @@ void EmojiListWidget::mouseReleaseEvent(QMouseEvent *e) {
|
|||
_jumpedToPremium.fire({});
|
||||
switch (_mode) {
|
||||
case Mode::Full:
|
||||
case Mode::UserpicBuilder:
|
||||
Settings::ShowPremium(_controller, u"animated_emoji"_q);
|
||||
break;
|
||||
case Mode::FullReactions:
|
||||
|
|
|
@ -68,6 +68,7 @@ enum class EmojiListMode {
|
|||
EmojiStatus,
|
||||
FullReactions,
|
||||
RecentReactions,
|
||||
UserpicBuilder,
|
||||
};
|
||||
|
||||
struct EmojiListDescriptor {
|
||||
|
|
|
@ -295,12 +295,15 @@ std::unique_ptr<Ui::TabbedSearch> MakeSearch(
|
|||
const style::EmojiPan &st,
|
||||
Fn<void(std::vector<QString>&&)> callback,
|
||||
not_null<Main::Session*> session,
|
||||
bool statusCategories) {
|
||||
bool statusCategories,
|
||||
bool profilePhotoCategories) {
|
||||
using Descriptor = Ui::SearchDescriptor;
|
||||
const auto owner = &session->data();
|
||||
auto result = std::make_unique<Ui::TabbedSearch>(parent, st, Descriptor{
|
||||
.st = st.search,
|
||||
.groups = (statusCategories
|
||||
.groups = (profilePhotoCategories
|
||||
? owner->emojiStatuses().profilePhotoGroupsValue()
|
||||
: statusCategories
|
||||
? owner->emojiStatuses().statusGroupsValue()
|
||||
: owner->emojiStatuses().emojiGroupsValue()),
|
||||
.customEmojiFactory = owner->customEmojiManager().factory(
|
||||
|
|
|
@ -83,7 +83,8 @@ using InlineChosen = InlineBots::ResultSelected;
|
|||
const style::EmojiPan &st,
|
||||
Fn<void(std::vector<QString>&&)> callback,
|
||||
not_null<Main::Session*> session,
|
||||
bool statusCategories = false);
|
||||
bool statusCategories = false,
|
||||
bool profilePhotoCategories = false);
|
||||
|
||||
class TabbedSelector : public Ui::RpWidget {
|
||||
public:
|
||||
|
|
|
@ -186,7 +186,7 @@ EmojiSelector::Selector EmojiSelector::createEmojiList(
|
|||
const auto tag = Data::CustomEmojiManager::SizeTag::Large;
|
||||
auto args = ChatHelpers::EmojiListDescriptor{
|
||||
.session = session,
|
||||
.mode = ChatHelpers::EmojiListMode::FullReactions,
|
||||
.mode = ChatHelpers::EmojiListMode::UserpicBuilder,
|
||||
.controller = _controller,
|
||||
.paused = [=] { return true; },
|
||||
.customRecentList = session->api().peerPhoto().profileEmojiList(),
|
||||
|
|
Loading…
Add table
Reference in a new issue