chore: remove Singleton & replace getIApp with getApp (#5514)
This commit is contained in:
@@ -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("...");
|
||||
|
||||
Reference in New Issue
Block a user