Support colorizing of the default palette.
This commit is contained in:
parent
cf5e41d81e
commit
1180d13a5c
2 changed files with 12 additions and 0 deletions
|
|
@ -126,6 +126,11 @@ palette::SetResult palette::setColor(QLatin1String name, QLatin1String from) {
|
||||||
return duplicate ? SetResult::Duplicate : SetResult::Ok;
|
return duplicate ? SetResult::Duplicate : SetResult::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void palette::reset(const colorizer &with) {
|
||||||
|
clear();
|
||||||
|
finalize(with);
|
||||||
|
}
|
||||||
|
|
||||||
void palette::reset() {
|
void palette::reset() {
|
||||||
clear();
|
clear();
|
||||||
finalize();
|
finalize();
|
||||||
|
|
@ -236,6 +241,11 @@ void reset() {
|
||||||
style::internal::resetIcons();
|
style::internal::resetIcons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset(const colorizer &with) {
|
||||||
|
GetMutable().reset(with);
|
||||||
|
style::internal::resetIcons();
|
||||||
|
}
|
||||||
|
|
||||||
int indexOfColor(color c) {
|
int indexOfColor(color c) {
|
||||||
return GetMutable().indexOfColor(c);
|
return GetMutable().indexOfColor(c);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ public:
|
||||||
};
|
};
|
||||||
SetResult setColor(QLatin1String name, uchar r, uchar g, uchar b, uchar a);
|
SetResult setColor(QLatin1String name, uchar r, uchar g, uchar b, uchar a);
|
||||||
SetResult setColor(QLatin1String name, QLatin1String from);
|
SetResult setColor(QLatin1String name, QLatin1String from);
|
||||||
|
void reset(const colorizer &with);
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
// Created not inited, should be finalized before usage.
|
// Created not inited, should be finalized before usage.
|
||||||
|
|
@ -66,6 +67,7 @@ palette::SetResult setColor(QLatin1String name, uchar r, uchar g, uchar b, uchar
|
||||||
palette::SetResult setColor(QLatin1String name, QLatin1String from);
|
palette::SetResult setColor(QLatin1String name, QLatin1String from);
|
||||||
void apply(const palette &other);
|
void apply(const palette &other);
|
||||||
void reset();
|
void reset();
|
||||||
|
void reset(const colorizer &with);
|
||||||
int indexOfColor(color c);
|
int indexOfColor(color c);
|
||||||
|
|
||||||
} // namespace main_palette
|
} // namespace main_palette
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue