Fix PathShiftGradient colors with custom palettes.
This commit is contained in:
parent
8589a8d850
commit
ef633ec503
2 changed files with 9 additions and 3 deletions
|
|
@ -29,12 +29,17 @@ std::weak_ptr<PathShiftGradient::AnimationData> PathShiftGradient::Animation;
|
||||||
PathShiftGradient::PathShiftGradient(
|
PathShiftGradient::PathShiftGradient(
|
||||||
const style::color &bg,
|
const style::color &bg,
|
||||||
const style::color &fg,
|
const style::color &fg,
|
||||||
Fn<void()> animationCallback)
|
Fn<void()> animationCallback,
|
||||||
|
rpl::producer<> paletteUpdated)
|
||||||
: _bg(bg)
|
: _bg(bg)
|
||||||
, _fg(fg)
|
, _fg(fg)
|
||||||
, _animationCallback(std::move(animationCallback)) {
|
, _animationCallback(std::move(animationCallback)) {
|
||||||
refreshColors();
|
refreshColors();
|
||||||
style::PaletteChanged(
|
if (!paletteUpdated) {
|
||||||
|
paletteUpdated = style::PaletteChanged();
|
||||||
|
}
|
||||||
|
std::move(
|
||||||
|
paletteUpdated
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
refreshColors();
|
refreshColors();
|
||||||
}, _lifetime);
|
}, _lifetime);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ public:
|
||||||
PathShiftGradient(
|
PathShiftGradient(
|
||||||
const style::color &bg,
|
const style::color &bg,
|
||||||
const style::color &fg,
|
const style::color &fg,
|
||||||
Fn<void()> animationCallback);
|
Fn<void()> animationCallback,
|
||||||
|
rpl::producer<> paletteUpdated = nullptr);
|
||||||
~PathShiftGradient();
|
~PathShiftGradient();
|
||||||
|
|
||||||
void startFrame(
|
void startFrame(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue