patterns: Fixed highlight colors of arrays not matching color shown in pattern data view
This commit is contained in:
parent
11441d632b
commit
ec9a947259
@ -84,6 +84,12 @@ namespace hex::pl {
|
||||
this->m_color = color;
|
||||
this->m_manualColor = true;
|
||||
}
|
||||
void setBaseColor(u32 color) {
|
||||
if (this->hasOverriddenColor())
|
||||
this->setColor(color);
|
||||
else
|
||||
this->m_color = color;
|
||||
}
|
||||
[[nodiscard]] bool hasOverriddenColor() const { return this->m_manualColor; }
|
||||
|
||||
[[nodiscard]] std::endian getEndian() const {
|
||||
|
@ -110,10 +110,8 @@ namespace hex::pl {
|
||||
void setEntries(std::vector<std::shared_ptr<Pattern>> &&entries) {
|
||||
this->m_entries = std::move(entries);
|
||||
|
||||
if (this->hasOverriddenColor()) {
|
||||
for (auto &entry : this->m_entries) {
|
||||
entry->setColor(this->getColor());
|
||||
}
|
||||
for (auto &entry : this->m_entries) {
|
||||
entry->setBaseColor(this->getColor());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,8 +122,8 @@ namespace hex::pl {
|
||||
this->m_highlightTemplate = this->m_template->clone();
|
||||
this->m_entryCount = count;
|
||||
|
||||
if (this->hasOverriddenColor())
|
||||
this->setColor(this->m_template->getColor());
|
||||
this->m_template->setBaseColor(this->getColor());
|
||||
this->m_highlightTemplate->setBaseColor(this->getColor());
|
||||
}
|
||||
|
||||
[[nodiscard]] bool operator==(const Pattern &other) const override {
|
||||
|
Loading…
x
Reference in New Issue
Block a user