mirror-chatterino2/src/widgets/TooltipWidget.hpp

42 lines
776 B
C++
Raw Normal View History

#pragma once
2018-06-26 14:09:39 +02:00
#include "widgets/BaseWindow.hpp"
#include <QLabel>
#include <QWidget>
2018-01-22 20:14:43 +01:00
#include <pajlada/signals/signal.hpp>
namespace chatterino {
class TooltipWidget : public BaseWindow
{
Q_OBJECT
public:
2018-05-26 17:11:09 +02:00
static TooltipWidget *getInstance();
TooltipWidget(BaseWidget *parent = nullptr);
2018-05-26 17:11:09 +02:00
virtual ~TooltipWidget() override;
void setText(QString text);
2018-08-24 11:56:42 +02:00
void setWordWrap(bool wrap);
#ifdef USEWINSDK
void raise();
#endif
protected:
void changeEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
2018-07-06 17:11:37 +02:00
void themeChangedEvent() override;
void scaleChangedEvent(float) override;
private:
2018-01-22 20:14:43 +01:00
void updateFont();
2018-07-06 19:23:47 +02:00
QLabel *displayText_;
pajlada::Signals::Connection fontChangedConnection_;
};
} // namespace chatterino