initial appbase integration

This commit is contained in:
fourtf
2018-11-21 21:37:41 +01:00
parent 9472283d76
commit cf26f10b80
26 changed files with 63 additions and 412 deletions
+4 -4
View File
@@ -90,10 +90,10 @@ void Label::paintEvent(QPaintEvent *)
QPainter painter(this);
QFontMetrics metrics = app->fonts->getFontMetrics(
this->getFontStyle(), this->getScale() * 96.f / this->logicalDpiX() *
this->getFontStyle(), this->scale() * 96.f / this->logicalDpiX() *
this->devicePixelRatioF());
painter.setFont(app->fonts->getFont(
this->getFontStyle(), this->getScale() * 96.f / this->logicalDpiX() *
this->getFontStyle(), this->scale() * 96.f / this->logicalDpiX() *
this->devicePixelRatioF()));
int offset = this->getOffset();
@@ -121,7 +121,7 @@ void Label::updateSize()
auto app = getApp();
QFontMetrics metrics =
app->fonts->getFontMetrics(this->fontStyle_, this->getScale());
app->fonts->getFontMetrics(this->fontStyle_, this->scale());
int width = metrics.width(this->text_) + (2 * this->getOffset());
int height = metrics.height();
@@ -132,7 +132,7 @@ void Label::updateSize()
int Label::getOffset()
{
return this->hasOffset_ ? int(8 * this->getScale()) : 0;
return this->hasOffset_ ? int(8 * this->scale()) : 0;
}
} // namespace chatterino