/* 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 */ #include "ui/controls/tabbed_search.h" #include "lang/lang_keys.h" #include "ui/widgets/input_fields.h" #include "ui/wrap/fade_wrap.h" #include "ui/widgets/buttons.h" #include "ui/painter.h" #include "ui/rect.h" #include "styles/style_chat_helpers.h" namespace Ui { namespace { constexpr auto kDebounceTimeout = crl::time(400); class GroupsStrip final : public RpWidget { public: GroupsStrip( QWidget *parent, const style::TabbedSearch &st, rpl::producer> groups, Text::CustomEmojiFactory factory); [[nodiscard]] rpl::producer chosen() const; void clearChosen(); private: struct Button { EmojiGroup group; QString iconId; std::unique_ptr icon; }; void init(rpl::producer> groups); void set(std::vector list); void paintEvent(QPaintEvent *e) override; void mousePressEvent(QMouseEvent *e) override; void mouseReleaseEvent(QMouseEvent *e) override; static inline auto FindById(auto &&buttons, QStringView id) { return ranges::find(buttons, id, &Button::iconId); } const style::TabbedSearch &_st; const Text::CustomEmojiFactory _factory; std::vector