mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed timestamps not updating when changed in the settings
This commit is contained in:
parent
f292d2e097
commit
8a77f918f6
5 changed files with 18 additions and 5 deletions
|
@ -89,6 +89,12 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags)
|
||||||
layoutRequired |= wordMaskChanged;
|
layoutRequired |= wordMaskChanged;
|
||||||
this->currentWordFlags = flags; // singletons::SettingManager::getInstance().getWordTypeMask();
|
this->currentWordFlags = flags; // singletons::SettingManager::getInstance().getWordTypeMask();
|
||||||
|
|
||||||
|
// check if timestamp format changed
|
||||||
|
bool timestampFormatChanged =
|
||||||
|
this->timestampFormat != singletons::SettingManager::getInstance().timestampFormat;
|
||||||
|
|
||||||
|
layoutRequired |= timestampFormatChanged;
|
||||||
|
|
||||||
// check if dpi changed
|
// check if dpi changed
|
||||||
bool scaleChanged = this->scale != scale;
|
bool scaleChanged = this->scale != scale;
|
||||||
layoutRequired |= scaleChanged;
|
layoutRequired |= scaleChanged;
|
||||||
|
|
|
@ -67,6 +67,7 @@ private:
|
||||||
int currentLayoutWidth = -1;
|
int currentLayoutWidth = -1;
|
||||||
int fontGeneration = -1;
|
int fontGeneration = -1;
|
||||||
int emoteGeneration = -1;
|
int emoteGeneration = -1;
|
||||||
|
QString timestampFormat;
|
||||||
float scale = -1;
|
float scale = -1;
|
||||||
unsigned int bufferUpdatedCount = 0;
|
unsigned int bufferUpdatedCount = 0;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "debug/log.hpp"
|
#include "debug/log.hpp"
|
||||||
#include "singletons/pathmanager.hpp"
|
#include "singletons/pathmanager.hpp"
|
||||||
#include "singletons/resourcemanager.hpp"
|
#include "singletons/resourcemanager.hpp"
|
||||||
|
#include "singletons/windowmanager.hpp"
|
||||||
|
|
||||||
using namespace chatterino::messages;
|
using namespace chatterino::messages;
|
||||||
|
|
||||||
|
@ -31,6 +32,9 @@ SettingManager::SettingManager()
|
||||||
|
|
||||||
this->moderationActions.connect([this](auto, auto) { this->updateModerationActions(); });
|
this->moderationActions.connect([this](auto, auto) { this->updateModerationActions(); });
|
||||||
this->ignoredKeywords.connect([this](auto, auto) { this->updateIgnoredKeywords(); });
|
this->ignoredKeywords.connect([this](auto, auto) { this->updateIgnoredKeywords(); });
|
||||||
|
|
||||||
|
this->timestampFormat.connect(
|
||||||
|
[](auto, auto) { singletons::WindowManager::getInstance().layoutVisibleChatWidgets(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageElement::Flags SettingManager::getWordFlags()
|
MessageElement::Flags SettingManager::getWordFlags()
|
||||||
|
@ -216,8 +220,12 @@ void SettingManager::updateIgnoredKeywords()
|
||||||
|
|
||||||
auto items = new std::vector<QString>();
|
auto items = new std::vector<QString>();
|
||||||
|
|
||||||
for (QString line : this->ignoredKeywords.getValue().split(newLineRegex)) {
|
for (const QString &line : this->ignoredKeywords.getValue().split(newLineRegex)) {
|
||||||
items->push_back(line);
|
QString line2 = line.trimmed();
|
||||||
|
|
||||||
|
if (!line2.isEmpty()) {
|
||||||
|
items->push_back(line2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->_ignoredKeywords = std::shared_ptr<std::vector<QString>>(items);
|
this->_ignoredKeywords = std::shared_ptr<std::vector<QString>>(items);
|
||||||
|
|
|
@ -27,8 +27,6 @@ IgnoreMessagesPage::IgnoreMessagesPage()
|
||||||
QString text = textEdit->toPlainText();
|
QString text = textEdit->toPlainText();
|
||||||
|
|
||||||
settings.ignoredKeywords = text;
|
settings.ignoredKeywords = text;
|
||||||
|
|
||||||
qDebug() << "xD";
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// ---- misc
|
// ---- misc
|
||||||
|
|
|
@ -21,7 +21,7 @@ IgnoreUsersPage::IgnoreUsersPage()
|
||||||
{
|
{
|
||||||
singletons::SettingManager &settings = singletons::SettingManager::getInstance();
|
singletons::SettingManager &settings = singletons::SettingManager::getInstance();
|
||||||
util::LayoutCreator<IgnoreUsersPage> layoutCreator(this);
|
util::LayoutCreator<IgnoreUsersPage> layoutCreator(this);
|
||||||
auto layout = layoutCreator.setLayoutType<QVBoxLayout>().withoutMargin();
|
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
|
||||||
|
|
||||||
auto label = layout.emplace<QLabel>(INFO);
|
auto label = layout.emplace<QLabel>(INFO);
|
||||||
label->setWordWrap(true);
|
label->setWordWrap(true);
|
||||||
|
|
Loading…
Reference in a new issue