added colon emote popup for ffz and bttv

This commit is contained in:
fourtf
2020-08-15 18:59:17 +02:00
parent 6781482485
commit f7237dccdd
26 changed files with 700 additions and 251 deletions
@@ -1,45 +1,9 @@
#pragma once
#include "widgets/listview/GenericListItem.hpp"
namespace chatterino {
class AbstractSwitcherItem
{
public:
/**
* @brief Attempt to obtain an AbstractSwitcherItem * from the passed QVariant.
*
* @param variant variant to try to convert to AbstractSwitcherItem *
*
* @return an AbstractSwitcherItem * if the QVariant could be converted,
* or nullptr if the variant did not contain AbstractSwitcherItem *
*/
static AbstractSwitcherItem *fromVariant(const QVariant &variant);
virtual ~AbstractSwitcherItem() = default;
/**
* @brief Since all switcher items are required to have an icon, we require it
* in the base class constructor.
*
* @param icon icon to be displayed in the switcher list
*/
AbstractSwitcherItem(const QIcon &icon);
/**
* @brief Action to perform when this item is activated. Must be implemented in
* subclasses.
*/
virtual void action() = 0;
virtual void paint(QPainter *painter, const QRect &rect) const = 0;
virtual QSize sizeHint(const QRect &rect) const = 0;
protected:
QIcon icon_;
static const QSize ICON_SIZE;
};
using AbstractSwitcherItem = GenericListItem;
} // namespace chatterino
// This allows us to store AbstractSwitcherItem * as a QVariant
Q_DECLARE_METATYPE(chatterino::AbstractSwitcherItem *);