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());
|
explicit BaseWidget(QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags());
|
||||||
virtual ~BaseWidget() override;
|
virtual ~BaseWidget() override;
|
||||||
|
|
||||||
float getScale() const;
|
virtual float getScale() const;
|
||||||
pajlada::Signals::Signal<float> scaleChanged;
|
pajlada::Signals::Signal<float> scaleChanged;
|
||||||
|
|
||||||
QSize getScaleIndependantSize() const;
|
QSize getScaleIndependantSize() const;
|
||||||
|
|
|
@ -65,6 +65,11 @@ BaseWindow::BaseWindow(QWidget *parent, Flags _flags)
|
||||||
CreateWindowShortcut(this, "CTRL+0", [] { getApp()->settings->uiScale.setValue(0); });
|
CreateWindowShortcut(this, "CTRL+0", [] { getApp()->settings->uiScale.setValue(0); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float BaseWindow::getScale() const
|
||||||
|
{
|
||||||
|
return this->scale;
|
||||||
|
}
|
||||||
|
|
||||||
BaseWindow::Flags BaseWindow::getFlags()
|
BaseWindow::Flags BaseWindow::getFlags()
|
||||||
{
|
{
|
||||||
return this->flags_;
|
return this->flags_;
|
||||||
|
|
|
@ -42,6 +42,8 @@ public:
|
||||||
|
|
||||||
void moveTo(QWidget *widget, QPoint point, bool offset = true);
|
void moveTo(QWidget *widget, QPoint point, bool offset = true);
|
||||||
|
|
||||||
|
virtual float getScale() const override;
|
||||||
|
|
||||||
Flags getFlags();
|
Flags getFlags();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -20,7 +20,7 @@ Label::Label(BaseWidget *parent, QString text, FontStyle style)
|
||||||
{
|
{
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
app->fonts->fontChanged.connect([=] { this->updateSize(); });
|
this->connections_.managedConnect(app->fonts->fontChanged, [this] { this->updateSize(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &Label::getText() const
|
const QString &Label::getText() const
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#include "singletons/fontmanager.hpp"
|
#include "singletons/fontmanager.hpp"
|
||||||
#include "widgets/basewidget.hpp"
|
#include "widgets/basewidget.hpp"
|
||||||
|
|
||||||
|
#include <pajlada/signals/signalholder.hpp>
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
namespace widgets {
|
namespace widgets {
|
||||||
|
|
||||||
|
@ -33,6 +35,8 @@ protected:
|
||||||
virtual QSize minimumSizeHint() const override;
|
virtual QSize minimumSizeHint() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
pajlada::Signals::SignalHolder connections_;
|
||||||
|
|
||||||
QString text_;
|
QString text_;
|
||||||
FontStyle fontStyle_;
|
FontStyle fontStyle_;
|
||||||
QSize preferedSize_;
|
QSize preferedSize_;
|
||||||
|
|
Loading…
Reference in a new issue