mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed #486
This commit is contained in:
parent
6c727cf82b
commit
573abe9f40
5 changed files with 13 additions and 2 deletions
|
@ -20,7 +20,7 @@ public:
|
|||
explicit BaseWidget(QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
virtual ~BaseWidget() override;
|
||||
|
||||
float getScale() const;
|
||||
virtual float getScale() const;
|
||||
pajlada::Signals::Signal<float> scaleChanged;
|
||||
|
||||
QSize getScaleIndependantSize() const;
|
||||
|
|
|
@ -65,6 +65,11 @@ BaseWindow::BaseWindow(QWidget *parent, Flags _flags)
|
|||
CreateWindowShortcut(this, "CTRL+0", [] { getApp()->settings->uiScale.setValue(0); });
|
||||
}
|
||||
|
||||
float BaseWindow::getScale() const
|
||||
{
|
||||
return this->scale;
|
||||
}
|
||||
|
||||
BaseWindow::Flags BaseWindow::getFlags()
|
||||
{
|
||||
return this->flags_;
|
||||
|
|
|
@ -42,6 +42,8 @@ public:
|
|||
|
||||
void moveTo(QWidget *widget, QPoint point, bool offset = true);
|
||||
|
||||
virtual float getScale() const override;
|
||||
|
||||
Flags getFlags();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -20,7 +20,7 @@ Label::Label(BaseWidget *parent, QString text, FontStyle style)
|
|||
{
|
||||
auto app = getApp();
|
||||
|
||||
app->fonts->fontChanged.connect([=] { this->updateSize(); });
|
||||
this->connections_.managedConnect(app->fonts->fontChanged, [this] { this->updateSize(); });
|
||||
}
|
||||
|
||||
const QString &Label::getText() const
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include "singletons/fontmanager.hpp"
|
||||
#include "widgets/basewidget.hpp"
|
||||
|
||||
#include <pajlada/signals/signalholder.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
|
@ -33,6 +35,8 @@ protected:
|
|||
virtual QSize minimumSizeHint() const override;
|
||||
|
||||
private:
|
||||
pajlada::Signals::SignalHolder connections_;
|
||||
|
||||
QString text_;
|
||||
FontStyle fontStyle_;
|
||||
QSize preferedSize_;
|
||||
|
|
Loading…
Reference in a new issue