chore: remove Singleton & replace getIApp with getApp (#5514)

This commit is contained in:
pajlada
2024-07-21 15:09:59 +02:00
committed by GitHub
parent 21186df058
commit 5deec1f02f
145 changed files with 802 additions and 856 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ bool MessageLayout::layout(int width, float scale, float imageScale,
this->currentLayoutWidth_ = width;
// check if layout state changed
const auto layoutGeneration = getIApp()->getWindows()->getGeneration();
const auto layoutGeneration = getApp()->getWindows()->getGeneration();
if (this->layoutState_ != layoutGeneration)
{
layoutRequired = true;
@@ -166,7 +166,7 @@ void MessageLayout::actuallyLayout(int width, MessageElementFlags flags)
{
if (hideModerationActions ||
(getSettings()->streamerModeHideModActions &&
getIApp()->getStreamerMode()->isEnabled()))
getApp()->getStreamerMode()->isEnabled()))
{
continue;
}
@@ -48,7 +48,7 @@ void MessageLayoutContainer::beginLayout(int width, float scale,
this->imageScale_ = imageScale;
this->flags_ = flags;
auto mediumFontMetrics =
getIApp()->getFonts()->getFontMetrics(FontStyle::ChatMedium, scale);
getApp()->getFonts()->getFontMetrics(FontStyle::ChatMedium, scale);
this->textLineHeight_ = mediumFontMetrics.height();
this->spaceWidth_ = mediumFontMetrics.horizontalAdvance(' ');
this->dotdotdotWidth_ = mediumFontMetrics.horizontalAdvance("...");