Files
chatterino2/src/widgets/dialogs/EmotePopup.hpp
nerix 65bfec963b feat(emote-popup): save size of popup (#5415)
* fix: remove added margins from emote window position

* chore: add changelog entry

* feat: store size of emote window

* chore: update changelog entry

* fix: disable layout save

* fix: PCH moment

* fix: multiply by scale
2024-06-01 10:38:39 +00:00

59 lines
1.4 KiB
C++

#pragma once
#include "widgets/BasePopup.hpp"
#include <pajlada/signals/signal.hpp>
#include <QLineEdit>
namespace chatterino {
struct Link;
class ChannelView;
class Channel;
using ChannelPtr = std::shared_ptr<Channel>;
class Notebook;
class TwitchChannel;
class EmotePopup : public BasePopup
{
public:
EmotePopup(QWidget *parent = nullptr);
void loadChannel(ChannelPtr channel);
void closeEvent(QCloseEvent *event) override;
pajlada::Signals::Signal<Link> linkClicked;
protected:
void resizeEvent(QResizeEvent *event) override;
void moveEvent(QMoveEvent *event) override;
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;
bool eventFilter(QObject *object, QEvent *event) override;
void saveBounds() const;
};
} // namespace chatterino