mirror-chatterino2/src/widgets/tooltipwidget.hpp

43 lines
913 B
C++
Raw Normal View History

#pragma once
#include "widgets/basewindow.hpp"
#include <QLabel>
#include <QWidget>
2018-01-22 20:14:43 +01:00
#include <pajlada/signals/signal.hpp>
namespace chatterino {
namespace widgets {
class TooltipWidget : public BaseWindow
{
Q_OBJECT
public:
TooltipWidget(BaseWidget *parent = nullptr);
2018-01-22 20:14:43 +01:00
~TooltipWidget();
void setText(QString text);
static TooltipWidget *getInstance()
{
static TooltipWidget *tooltipWidget = nullptr;
if (tooltipWidget == nullptr) {
tooltipWidget = new TooltipWidget();
}
return tooltipWidget;
}
protected:
2018-01-22 20:14:43 +01:00
virtual void changeEvent(QEvent *) override;
virtual void leaveEvent(QEvent *) override;
virtual void dpiMultiplierChanged(float, float) override;
private:
QLabel *displayText;
2018-01-22 20:14:43 +01:00
pajlada::Signals::Connection fontChangedConnection;
2018-01-22 20:14:43 +01:00
void updateFont();
};
} // namespace widgets
} // namespace chatterino