Don't forget old colors.
This commit is contained in:
parent
ab5219f546
commit
08888d5ead
@ -244,9 +244,6 @@ void ThemeManager::on_update_accent_colors(FlatHashMap<AccentColorId, vector<int
|
|||||||
vector<AccentColorId> accent_color_ids) {
|
vector<AccentColorId> accent_color_ids) {
|
||||||
auto are_equal = [](const FlatHashMap<AccentColorId, vector<int32>, AccentColorIdHash> &lhs,
|
auto are_equal = [](const FlatHashMap<AccentColorId, vector<int32>, AccentColorIdHash> &lhs,
|
||||||
const FlatHashMap<AccentColorId, vector<int32>, AccentColorIdHash> &rhs) {
|
const FlatHashMap<AccentColorId, vector<int32>, AccentColorIdHash> &rhs) {
|
||||||
if (lhs.size() != rhs.size()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for (auto &lhs_it : lhs) {
|
for (auto &lhs_it : lhs) {
|
||||||
auto rhs_it = rhs.find(lhs_it.first);
|
auto rhs_it = rhs.find(lhs_it.first);
|
||||||
if (rhs_it == rhs.end() || rhs_it->second != lhs_it.second) {
|
if (rhs_it == rhs.end() || rhs_it->second != lhs_it.second) {
|
||||||
@ -259,8 +256,12 @@ void ThemeManager::on_update_accent_colors(FlatHashMap<AccentColorId, vector<int
|
|||||||
are_equal(dark_colors, accent_colors_.dark_colors_)) {
|
are_equal(dark_colors, accent_colors_.dark_colors_)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
accent_colors_.light_colors_ = std::move(light_colors);
|
for (auto &it : light_colors) {
|
||||||
accent_colors_.dark_colors_ = std::move(dark_colors);
|
accent_colors_.light_colors_[it.first] = std::move(it.second);
|
||||||
|
}
|
||||||
|
for (auto &it : dark_colors) {
|
||||||
|
accent_colors_.dark_colors_[it.first] = std::move(it.second);
|
||||||
|
}
|
||||||
accent_colors_.accent_color_ids_ = std::move(accent_color_ids);
|
accent_colors_.accent_color_ids_ = std::move(accent_color_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user