2017-12-23 22:17:38 +01:00
|
|
|
#pragma once
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/BaseWindow.hpp"
|
2017-12-23 22:17:38 +01:00
|
|
|
|
|
|
|
#include <QLabel>
|
2017-12-23 23:24:35 +01:00
|
|
|
#include <QWidget>
|
2018-01-22 20:14:43 +01:00
|
|
|
#include <pajlada/signals/signal.hpp>
|
2017-12-23 22:17:38 +01:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
2018-01-22 15:06:36 +01:00
|
|
|
class TooltipWidget : public BaseWindow
|
2017-12-23 22:17:38 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2018-04-03 02:55:32 +02:00
|
|
|
|
2017-12-23 22:17:38 +01:00
|
|
|
public:
|
2018-05-26 17:11:09 +02:00
|
|
|
static TooltipWidget *getInstance();
|
|
|
|
|
2017-12-23 22:17:38 +01:00
|
|
|
TooltipWidget(BaseWidget *parent = nullptr);
|
2018-05-26 17:11:09 +02:00
|
|
|
virtual ~TooltipWidget() override;
|
2017-12-23 22:17:38 +01:00
|
|
|
|
|
|
|
void setText(QString text);
|
|
|
|
|
2018-05-24 10:03:07 +02:00
|
|
|
#ifdef USEWINSDK
|
|
|
|
void raise();
|
|
|
|
#endif
|
|
|
|
|
2018-01-22 15:06:36 +01:00
|
|
|
protected:
|
2018-04-03 02:55:32 +02:00
|
|
|
void changeEvent(QEvent *) override;
|
|
|
|
void leaveEvent(QEvent *) override;
|
2018-07-06 17:11:37 +02:00
|
|
|
void themeChangedEvent() override;
|
2018-04-03 02:55:32 +02:00
|
|
|
void scaleChangedEvent(float) override;
|
2018-01-22 15:06:36 +01:00
|
|
|
|
2017-12-23 22:17:38 +01:00
|
|
|
private:
|
|
|
|
QLabel *displayText;
|
2018-01-22 20:14:43 +01:00
|
|
|
pajlada::Signals::Connection fontChangedConnection;
|
2018-01-22 15:06:36 +01:00
|
|
|
|
2018-01-22 20:14:43 +01:00
|
|
|
void updateFont();
|
2017-12-23 22:17:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|