mirror-chatterino2/src/widgets/tooltipwidget.hpp

46 lines
920 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:
void changeEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
2018-05-16 14:55:45 +02:00
void themeRefreshEvent() override;
void scaleChangedEvent(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