Skip to content

Commit

Permalink
Support colorizing of the default palette.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 2, 2021
1 parent cf5e41d commit 1180d13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ui/style/style_core_palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ palette::SetResult palette::setColor(QLatin1String name, QLatin1String from) {
return duplicate ? SetResult::Duplicate : SetResult::Ok;
}

void palette::reset(const colorizer &with) {
clear();
finalize(with);
}

void palette::reset() {
clear();
finalize();
Expand Down Expand Up @@ -236,6 +241,11 @@ void reset() {
style::internal::resetIcons();
}

void reset(const colorizer &with) {
GetMutable().reset(with);
style::internal::resetIcons();
}

int indexOfColor(color c) {
return GetMutable().indexOfColor(c);
}
Expand Down
2 changes: 2 additions & 0 deletions ui/style/style_core_palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class palette : public palette_data {
};
SetResult setColor(QLatin1String name, uchar r, uchar g, uchar b, uchar a);
SetResult setColor(QLatin1String name, QLatin1String from);
void reset(const colorizer &with);
void reset();

// Created not inited, should be finalized before usage.
Expand Down Expand Up @@ -66,6 +67,7 @@ palette::SetResult setColor(QLatin1String name, uchar r, uchar g, uchar b, uchar
palette::SetResult setColor(QLatin1String name, QLatin1String from);
void apply(const palette &other);
void reset();
void reset(const colorizer &with);
int indexOfColor(color c);

} // namespace main_palette
Expand Down

0 comments on commit 1180d13

Please sign in to comment.