Rebuild slider when relevant values change.

This commit is contained in:
John Preston
2025-11-20 20:46:53 +04:00
parent 8c1844b1c0
commit 19225c7dd3
6 changed files with 177 additions and 101 deletions
@@ -515,7 +515,8 @@ void PaidReactionsBox(
return Ui::ColorFromSerialized(coloring.bgLight);
};
AddStarSelectBubble(
box,
content,
BoxShowFinishes(box),
state->chosen.value(),
args.max,
videoStream ? activeFgOverride : Fn<QColor(int)>());
@@ -938,7 +939,8 @@ void AddStarSelectBalance(
}
not_null<Premium::BubbleWidget*> AddStarSelectBubble(
not_null<GenericBox*> box,
not_null<VerticalLayout*> container,
rpl::producer<> showFinishes,
rpl::producer<int> value,
int max,
Fn<QColor(int)> activeFgOverride) {
@@ -958,14 +960,15 @@ not_null<Premium::BubbleWidget*> AddStarSelectBubble(
});
const auto bubble = Premium::AddBubbleRow(
box->verticalLayout(),
container,
st::boostBubble,
BoxShowFinishes(box),
std::move(showFinishes),
std::move(bubbleRowState),
Premium::BubbleType::Credits,
nullptr,
&st::paidReactBubbleIcon,
st::boxRowPadding);
bubble->show();
if (activeFgOverride) {
std::move(value) | rpl::start_with_next([=](int count) {
bubble->setBrushOverride(activeFgOverride(count));
@@ -99,7 +99,8 @@ void AddStarSelectBalance(
bool dark = false);
not_null<Premium::BubbleWidget*> AddStarSelectBubble(
not_null<GenericBox*> box,
not_null<VerticalLayout*> container,
rpl::producer<> showFinishes,
rpl::producer<int> value,
int max,
Fn<QColor(int)> activeFgOverride = nullptr);