mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed label ui scale
This commit is contained in:
parent
22167f33f2
commit
59ee091722
2 changed files with 10 additions and 10 deletions
|
@ -213,12 +213,10 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
|||
QPainter painter(this);
|
||||
float scale = this->getScale();
|
||||
|
||||
qDebug() << painter.device()->devicePixelRatioF() << painter.device()->devicePixelRatioFScale()
|
||||
<< painter.device()->logicalDpiX();
|
||||
|
||||
painter.setFont(getApp()->fonts->getFont(FontStyle::UiTabs, scale * this->devicePixelRatioF()));
|
||||
QFontMetrics metrics =
|
||||
app->fonts->getFontMetrics(FontStyle::UiTabs, scale * this->devicePixelRatioF());
|
||||
painter.setFont(getApp()->fonts->getFont(
|
||||
FontStyle::UiTabs, scale * 96.f / this->logicalDpiX() * this->devicePixelRatioF()));
|
||||
QFontMetrics metrics = app->fonts->getFontMetrics(
|
||||
FontStyle::UiTabs, scale * 96.f / this->logicalDpiX() * this->devicePixelRatioF());
|
||||
|
||||
int height = int(scale * NOTEBOOK_TAB_HEIGHT);
|
||||
// int fullHeight = (int)(scale * 48);
|
||||
|
|
|
@ -89,10 +89,12 @@ void Label::paintEvent(QPaintEvent *)
|
|||
auto app = getApp();
|
||||
|
||||
QPainter painter(this);
|
||||
QFontMetrics metrics = app->fonts->getFontMetrics(this->getFontStyle(),
|
||||
this->getScale() * this->devicePixelRatioF());
|
||||
painter.setFont(
|
||||
app->fonts->getFont(this->getFontStyle(), this->getScale() * this->devicePixelRatioF()));
|
||||
QFontMetrics metrics = app->fonts->getFontMetrics(
|
||||
this->getFontStyle(),
|
||||
this->getScale() * 96.f / this->logicalDpiX() * this->devicePixelRatioF());
|
||||
painter.setFont(app->fonts->getFont(
|
||||
this->getFontStyle(),
|
||||
this->getScale() * 96.f / this->logicalDpiX() * this->devicePixelRatioF()));
|
||||
|
||||
int offset = this->getOffset();
|
||||
|
||||
|
|
Loading…
Reference in a new issue