small refactor
This commit is contained in:
@@ -127,8 +127,7 @@ void WindowManager::updateWordTypeMask()
|
||||
|
||||
// bits
|
||||
flags.set(MEF::BitsAmount);
|
||||
flags.set(settings->animateEmotes ? MEF::BitsAnimated
|
||||
: MEF::BitsStatic);
|
||||
flags.set(settings->animateEmotes ? MEF::BitsAnimated : MEF::BitsStatic);
|
||||
|
||||
// badges
|
||||
flags.set(settings->showBadgesGlobalAuthority ? MEF::BadgeGlobalAuthority
|
||||
@@ -148,9 +147,9 @@ void WindowManager::updateWordTypeMask()
|
||||
flags.set(MEF::AlwaysShow);
|
||||
flags.set(MEF::Collapsed);
|
||||
flags.set(settings->boldUsernames ? MEF::BoldUsername
|
||||
: MEF::NonBoldUsername);
|
||||
: MEF::NonBoldUsername);
|
||||
flags.set(settings->lowercaseDomains ? MEF::LowercaseLink
|
||||
: MEF::OriginalLink);
|
||||
: MEF::OriginalLink);
|
||||
|
||||
// update flags
|
||||
MessageElementFlags newFlags = static_cast<MessageElementFlags>(flags);
|
||||
@@ -165,7 +164,7 @@ void WindowManager::updateWordTypeMask()
|
||||
|
||||
void WindowManager::layoutChannelViews(Channel *channel)
|
||||
{
|
||||
this->layout.invoke(channel);
|
||||
this->layoutRequested.invoke(channel);
|
||||
}
|
||||
|
||||
void WindowManager::forceLayoutChannelViews()
|
||||
@@ -176,15 +175,12 @@ void WindowManager::forceLayoutChannelViews()
|
||||
|
||||
void WindowManager::repaintVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
if (this->mainWindow_ != nullptr)
|
||||
{
|
||||
this->mainWindow_->repaintVisibleChatWidgets(channel);
|
||||
}
|
||||
this->layoutRequested.invoke(channel);
|
||||
}
|
||||
|
||||
void WindowManager::repaintGifEmotes()
|
||||
{
|
||||
this->repaintGifs.invoke();
|
||||
this->gifRepaintRequested.invoke();
|
||||
}
|
||||
|
||||
// void WindowManager::updateAll()
|
||||
|
||||
@@ -67,14 +67,6 @@ public:
|
||||
MessageElementFlags getWordFlags();
|
||||
void updateWordTypeMask();
|
||||
|
||||
pajlada::Signals::NoArgSignal repaintGifs;
|
||||
|
||||
// This signal fires whenever views rendering a channel, or all views if the
|
||||
// channel is a nullptr, need to redo their layout
|
||||
pajlada::Signals::Signal<Channel *> layout;
|
||||
|
||||
pajlada::Signals::NoArgSignal wordFlagsChanged;
|
||||
|
||||
// Sends an alert to the main window
|
||||
// It reads the `longAlert` setting to decide whether the alert will expire
|
||||
// or not
|
||||
@@ -85,6 +77,15 @@ public:
|
||||
// again
|
||||
void queueSave();
|
||||
|
||||
/// Signals
|
||||
pajlada::Signals::NoArgSignal gifRepaintRequested;
|
||||
|
||||
// This signal fires whenever views rendering a channel, or all views if the
|
||||
// channel is a nullptr, need to redo their layout
|
||||
pajlada::Signals::Signal<Channel *> layoutRequested;
|
||||
|
||||
pajlada::Signals::NoArgSignal wordFlagsChanged;
|
||||
|
||||
private:
|
||||
void encodeNodeRecusively(SplitContainer::Node *node, QJsonObject &obj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user