refactor: Remove most raw accesses into Application (#5104)

This commit is contained in:
pajlada
2024-01-19 17:59:55 +01:00
committed by GitHub
parent 326a402710
commit 4380ef8c5f
82 changed files with 552 additions and 452 deletions
@@ -442,7 +442,7 @@ void TextLayoutElement::paint(QPainter &painter,
painter.setPen(this->color_);
painter.setFont(app->fonts->getFont(this->style_, this->scale_));
painter.setFont(app->getFonts()->getFont(this->style_, this->scale_));
painter.drawText(
QRectF(this->getRect().x(), this->getRect().y(), 10000, 10000), text,
@@ -463,7 +463,7 @@ int TextLayoutElement::getMouseOverIndex(const QPoint &abs) const
auto *app = getApp();
auto metrics = app->fonts->getFontMetrics(this->style_, this->scale_);
auto metrics = app->getFonts()->getFontMetrics(this->style_, this->scale_);
auto x = this->getRect().left();
for (auto i = 0; i < this->getText().size(); i++)
@@ -498,7 +498,7 @@ int TextLayoutElement::getXFromIndex(size_t index)
auto *app = getApp();
QFontMetrics metrics =
app->fonts->getFontMetrics(this->style_, this->scale_);
app->getFonts()->getFontMetrics(this->style_, this->scale_);
if (index <= 0)
{
@@ -546,7 +546,7 @@ void TextIconLayoutElement::paint(QPainter &painter,
{
auto *app = getApp();
QFont font = app->fonts->getFont(FontStyle::Tiny, this->scale);
QFont font = app->getFonts()->getFont(FontStyle::Tiny, this->scale);
painter.setPen(messageColors.system);
painter.setFont(font);