mirror-chatterino2/src/widgets/dialogs/EmotePopup.hpp
pajlada b074a8f7eb
Refactor the EmotePopup file (#4239)
Flatten the anonymous namespace
Make the `loadEmojis` functions static
Make the `filterEmoteMap` function static
Return an EmoteMap from `filterEmoteMap` instead of an EmoteMap*
Other misc cool changes :-)
2022-12-17 18:33:17 +01:00

51 lines
1.2 KiB
C++

#pragma once
#include "providers/twitch/TwitchChannel.hpp"
#include "widgets/BasePopup.hpp"
#include "widgets/Notebook.hpp"
#include <pajlada/signals/signal.hpp>
#include <QLineEdit>
namespace chatterino {
struct Link;
class ChannelView;
class Channel;
using ChannelPtr = std::shared_ptr<Channel>;
class EmotePopup : public BasePopup
{
public:
EmotePopup(QWidget *parent = nullptr);
void loadChannel(ChannelPtr channel);
void closeEvent(QCloseEvent *event) override;
pajlada::Signals::Signal<Link> linkClicked;
private:
ChannelView *globalEmotesView_{};
ChannelView *channelEmotesView_{};
ChannelView *subEmotesView_{};
ChannelView *viewEmojis_{};
/**
* @brief Visible only when the user has specified a search query into the `search_` input.
* Otherwise the `notebook_` and all other views are visible.
*/
ChannelView *searchView_{};
ChannelPtr channel_;
TwitchChannel *twitchChannel_{};
QLineEdit *search_;
Notebook *notebook_;
void filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
const QString &searchText);
void filterEmotes(const QString &text);
void addShortcuts() override;
};
} // namespace chatterino