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(
|
||||
const style::color &bg,
|
||||
const style::color &fg,
|
||||
Fn<void()> animationCallback)
|
||||
Fn<void()> animationCallback,
|
||||
rpl::producer<> paletteUpdated)
|
||||
: _bg(bg)
|
||||
, _fg(fg)
|
||||
, _animationCallback(std::move(animationCallback)) {
|
||||
refreshColors();
|
||||
style::PaletteChanged(
|
||||
if (!paletteUpdated) {
|
||||
paletteUpdated = style::PaletteChanged();
|
||||
}
|
||||
std::move(
|
||||
paletteUpdated
|
||||
) | rpl::start_with_next([=] {
|
||||
refreshColors();
|
||||
}, _lifetime);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ public:
|
|||
PathShiftGradient(
|
||||
const style::color &bg,
|
||||
const style::color &fg,
|
||||
Fn<void()> animationCallback);
|
||||
Fn<void()> animationCallback,
|
||||
rpl::producer<> paletteUpdated = nullptr);
|
||||
~PathShiftGradient();
|
||||
|
||||
void startFrame(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue