Remove getApp and getSettings calls from Message-Rendering (#4535)

* refactor: remove singletons from message rendering

* chore: add changelog entry

* Disable the `cppcoreguidelines-avoid-const-or-ref-data-members` clang-tidy check

* auto *app

* Selection is a struct, not a class

* Use ChannelView's `signalHolder_` instead of `channelConnections_`

* Remove `applySettings` step, instead just connect & set each setting individually

* rename & constify some context values

* Handle empty "last message color" setting value better (as it was
        originally in this pr before I removed that change :-)

* unrelated mini refactor cleanup

* let painSelection handle size_t instead of int

* Add some more comments to the MessageLayoutContext structs

---------

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2023-07-30 14:52:39 +02:00
committed by GitHub
parent 95aee044e2
commit 71594ad0d8
14 changed files with 312 additions and 131 deletions
+4
View File
@@ -1,6 +1,7 @@
#pragma once
#include "common/FlagsEnum.hpp"
#include "messages/layouts/MessageLayoutContext.hpp"
#include "messages/LimitedQueue.hpp"
#include "messages/LimitedQueueSnapshot.hpp"
#include "messages/Selection.hpp"
@@ -343,6 +344,9 @@ private:
std::unordered_set<std::shared_ptr<MessageLayout>> messagesOnScreen_;
MessageColors messageColors_;
MessagePreferences messagePreferences_;
static constexpr int leftPadding = 8;
static constexpr int scrollbarPadding = 8;