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
+3 -4
View File
@@ -78,8 +78,6 @@ bool MessageLayout::layout(int width, float scale, MessageElementFlags flags)
{
// BenchmarkGuard benchmark("MessageLayout::layout()");
auto *app = getApp();
bool layoutRequired = false;
// check if width changed
@@ -88,11 +86,12 @@ bool MessageLayout::layout(int width, float scale, MessageElementFlags flags)
this->currentLayoutWidth_ = width;
// check if layout state changed
if (this->layoutState_ != app->windows->getGeneration())
const auto layoutGeneration = getIApp()->getWindows()->getGeneration();
if (this->layoutState_ != layoutGeneration)
{
layoutRequired = true;
this->flags.set(MessageLayoutFlag::RequiresBufferUpdate);
this->layoutState_ = app->windows->getGeneration();
this->layoutState_ = layoutGeneration;
}
// check if work mask changed