mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Change default for business recipients.
This commit is contained in:
parent
dd0bdd62fb
commit
c513906996
2 changed files with 5 additions and 5 deletions
|
@ -36,7 +36,7 @@ struct BusinessChats {
|
||||||
struct BusinessRecipients {
|
struct BusinessRecipients {
|
||||||
BusinessChats included;
|
BusinessChats included;
|
||||||
BusinessChats excluded;
|
BusinessChats excluded;
|
||||||
bool onlyIncluded = false;
|
bool allButExcluded = false;
|
||||||
|
|
||||||
friend inline bool operator==(
|
friend inline bool operator==(
|
||||||
const BusinessRecipients &a,
|
const BusinessRecipients &a,
|
||||||
|
|
|
@ -165,7 +165,7 @@ void AddBusinessRecipientsSelector(
|
||||||
*data = std::move(now);
|
*data = std::move(now);
|
||||||
};
|
};
|
||||||
const auto group = std::make_shared<Ui::RadiobuttonGroup>(
|
const auto group = std::make_shared<Ui::RadiobuttonGroup>(
|
||||||
data->current().onlyIncluded ? kSelectedOnly : kAllExcept);
|
data->current().allButExcluded ? kAllExcept : kSelectedOnly);
|
||||||
const auto everyone = container->add(
|
const auto everyone = container->add(
|
||||||
object_ptr<Ui::Radiobutton>(
|
object_ptr<Ui::Radiobutton>(
|
||||||
container,
|
container,
|
||||||
|
@ -231,7 +231,7 @@ void AddBusinessRecipientsSelector(
|
||||||
|
|
||||||
excludeWrap->toggleOn(data->value(
|
excludeWrap->toggleOn(data->value(
|
||||||
) | rpl::map([](const Data::BusinessRecipients &value) {
|
) | rpl::map([](const Data::BusinessRecipients &value) {
|
||||||
return !value.onlyIncluded;
|
return value.allButExcluded;
|
||||||
}));
|
}));
|
||||||
excludeWrap->finishAnimating();
|
excludeWrap->finishAnimating();
|
||||||
|
|
||||||
|
@ -280,13 +280,13 @@ void AddBusinessRecipientsSelector(
|
||||||
|
|
||||||
includeWrap->toggleOn(data->value(
|
includeWrap->toggleOn(data->value(
|
||||||
) | rpl::map([](const Data::BusinessRecipients &value) {
|
) | rpl::map([](const Data::BusinessRecipients &value) {
|
||||||
return value.onlyIncluded;
|
return !value.allButExcluded;
|
||||||
}));
|
}));
|
||||||
includeWrap->finishAnimating();
|
includeWrap->finishAnimating();
|
||||||
|
|
||||||
group->setChangedCallback([=](int value) {
|
group->setChangedCallback([=](int value) {
|
||||||
change([&](Data::BusinessRecipients &data) {
|
change([&](Data::BusinessRecipients &data) {
|
||||||
data.onlyIncluded = (value == kSelectedOnly);
|
data.allButExcluded = (value == kAllExcept);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue