refactor: Remove most raw accesses into Application (#5104)
This commit is contained in:
@@ -522,14 +522,14 @@ void TextElement::addToContainer(MessageLayoutContainer &container,
|
||||
if (flags.hasAny(this->getFlags()))
|
||||
{
|
||||
QFontMetrics metrics =
|
||||
app->fonts->getFontMetrics(this->style_, container.getScale());
|
||||
app->getFonts()->getFontMetrics(this->style_, container.getScale());
|
||||
|
||||
for (Word &word : this->words_)
|
||||
{
|
||||
auto getTextLayoutElement = [&](QString text, int width,
|
||||
bool hasTrailingSpace) {
|
||||
auto color = this->color_.getColor(*app->themes);
|
||||
app->themes->normalizeColor(color);
|
||||
auto color = this->color_.getColor(*app->getThemes());
|
||||
app->getThemes()->normalizeColor(color);
|
||||
|
||||
auto *e = (new TextLayoutElement(
|
||||
*this, text, QSize(width, metrics.height()),
|
||||
@@ -642,12 +642,12 @@ void SingleLineTextElement::addToContainer(MessageLayoutContainer &container,
|
||||
if (flags.hasAny(this->getFlags()))
|
||||
{
|
||||
QFontMetrics metrics =
|
||||
app->fonts->getFontMetrics(this->style_, container.getScale());
|
||||
app->getFonts()->getFontMetrics(this->style_, container.getScale());
|
||||
|
||||
auto getTextLayoutElement = [&](QString text, int width,
|
||||
bool hasTrailingSpace) {
|
||||
auto color = this->color_.getColor(*app->themes);
|
||||
app->themes->normalizeColor(color);
|
||||
auto color = this->color_.getColor(*app->getThemes());
|
||||
app->getThemes()->normalizeColor(color);
|
||||
|
||||
auto *e = (new TextLayoutElement(
|
||||
*this, text, QSize(width, metrics.height()), color,
|
||||
|
||||
Reference in New Issue
Block a user