diff --git a/ui/style/style_core_palette.cpp b/ui/style/style_core_palette.cpp index 336aae7..d2f356a 100644 --- a/ui/style/style_core_palette.cpp +++ b/ui/style/style_core_palette.cpp @@ -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(); @@ -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); } diff --git a/ui/style/style_core_palette.h b/ui/style/style_core_palette.h index 757467d..92cdb93 100644 --- a/ui/style/style_core_palette.h +++ b/ui/style/style_core_palette.h @@ -31,6 +31,7 @@ public: }; 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. @@ -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