mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed finishing of toggle animations in peer permissions box.
This commit is contained in:
parent
a8a9b638bb
commit
7881cb8946
2 changed files with 10 additions and 4 deletions
|
@ -224,8 +224,15 @@ not_null<Ui::SettingsButton*> SendMediaToggle(
|
||||||
toggleButton->setToggleLocked(locked.has_value());
|
toggleButton->setToggleLocked(locked.has_value());
|
||||||
struct State final {
|
struct State final {
|
||||||
Ui::Animations::Simple animation;
|
Ui::Animations::Simple animation;
|
||||||
|
rpl::lifetime finishAnimatingLifetime;
|
||||||
};
|
};
|
||||||
const auto state = button->lifetime().make_state<State>();
|
const auto state = button->lifetime().make_state<State>();
|
||||||
|
rpl::duplicate(
|
||||||
|
checkedValue
|
||||||
|
) | rpl::start_with_next([=] {
|
||||||
|
button->finishAnimating();
|
||||||
|
toggleButton->finishAnimating();
|
||||||
|
}, state->finishAnimatingLifetime);
|
||||||
const auto label = Ui::CreateChild<Ui::FlatLabel>(
|
const auto label = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
button,
|
button,
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
|
@ -303,6 +310,7 @@ not_null<Ui::SettingsButton*> SendMediaToggle(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
if (!handleLocked()) {
|
if (!handleLocked()) {
|
||||||
toggleMedia(!button->toggled());
|
toggleMedia(!button->toggled());
|
||||||
|
state->finishAnimatingLifetime.destroy();
|
||||||
}
|
}
|
||||||
}, toggleButton->lifetime());
|
}, toggleButton->lifetime());
|
||||||
|
|
||||||
|
@ -969,9 +977,7 @@ EditFlagsControl<ChatRestrictions, Ui::RpWidget> CreateEditRestrictions(
|
||||||
auto wrap = object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
auto wrap = object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||||
container,
|
container,
|
||||||
object_ptr<Ui::VerticalLayout>(container));
|
object_ptr<Ui::VerticalLayout>(container));
|
||||||
if (locked.has_value()) {
|
wrap->hide(anim::type::instant);
|
||||||
wrap->hide(anim::type::instant);
|
|
||||||
}
|
|
||||||
SendMediaToggle(
|
SendMediaToggle(
|
||||||
container,
|
container,
|
||||||
state->restrictions.events_starting_with(
|
state->restrictions.events_starting_with(
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit a5020ac5bc2752319c10a9749fc973d9fb58c710
|
Subproject commit 5535a3fe5720272015dea2ff608bb759634ba7e5
|
Loading…
Add table
Reference in a new issue