mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-01 17:43:03 +02:00
Update settings_ayu.cpp
This commit is contained in:
parent
f4c01a6a20
commit
8bea85e597
1 changed files with 77 additions and 36 deletions
|
@ -846,44 +846,85 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container) {
|
||||||
},
|
},
|
||||||
container->lifetime());
|
container->lifetime());
|
||||||
|
|
||||||
AddButtonWithIcon(
|
AddSkip(container);
|
||||||
container,
|
AddDivider(container);
|
||||||
tr::ayu_ShowForwardsCount(),
|
AddSkip(container);
|
||||||
st::settingsButtonNoIcon
|
|
||||||
)->toggleOn(
|
|
||||||
rpl::single(settings.showForwards)
|
|
||||||
)->toggledValue(
|
|
||||||
) | rpl::filter(
|
|
||||||
[=](bool enabled)
|
|
||||||
{
|
|
||||||
return (enabled != settings.showForwards);
|
|
||||||
}) | start_with_next(
|
|
||||||
[=](bool enabled)
|
|
||||||
{
|
|
||||||
AyuSettings::set_showForwards(enabled);
|
|
||||||
AyuSettings::save();
|
|
||||||
},
|
|
||||||
container->lifetime());
|
|
||||||
|
|
||||||
AddButtonWithIcon(
|
AddButtonWithIcon(
|
||||||
container,
|
container,
|
||||||
tr::ayu_ShowForwardsRatio(),
|
tr::ayu_HideChannelReactions(),
|
||||||
st::settingsButtonNoIcon
|
st::settingsButtonNoIcon
|
||||||
)->toggleOn(
|
)->toggleOn(
|
||||||
rpl::single(settings.showForwardsRatio)
|
rpl::single(!settings->hideChannelReactions)
|
||||||
)->toggledValue(
|
)->toggledValue(
|
||||||
) | rpl::filter(
|
) | rpl::filter(
|
||||||
[=](bool enabled)
|
[=](bool enabled)
|
||||||
{
|
{
|
||||||
return (enabled != settings.showForwardsRatio);
|
return (!enabled != settings->hideChannelReactions);
|
||||||
}) | start_with_next(
|
}) | start_with_next(
|
||||||
[=](bool enabled)
|
[=](bool enabled)
|
||||||
{
|
{
|
||||||
AyuSettings::set_showForwardsRatio(enabled);
|
AyuSettings::set_hideChannelReactions(!enabled);
|
||||||
AyuSettings::save();
|
AyuSettings::save();
|
||||||
},
|
},
|
||||||
container->lifetime());
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_HideGroupReactions(),
|
||||||
|
st::settingsButtonNoIcon
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(!settings->hideGroupReactions)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (!enabled != settings->hideGroupReactions);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
AyuSettings::set_hideGroupReactions(!enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_ShowForwardsCount(),
|
||||||
|
st::settingsButtonNoIcon
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings.showForwards)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings.showForwards);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
AyuSettings::set_showForwards(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_ShowForwardsRatio(),
|
||||||
|
st::settingsButtonNoIcon
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings.showForwardsRatio)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings.showForwardsRatio);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
AyuSettings::set_showForwardsRatio(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupAppIcon(not_null<Ui::VerticalLayout*> container) {
|
void SetupAppIcon(not_null<Ui::VerticalLayout*> container) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue