Fix calls peer-to-peer privacy button icon.

This commit is contained in:
John Preston 2023-07-18 22:38:28 +04:00
parent 4e046ca31a
commit 04a969cc5f
3 changed files with 7 additions and 4 deletions

View file

@ -764,7 +764,8 @@ object_ptr<Ui::RpWidget> CallsPrivacyController::setupBelowWidget(
tr::lng_settings_calls_peer_to_peer_button(), tr::lng_settings_calls_peer_to_peer_button(),
{ &st::settingsIconArrows, kIconLightBlue }, { &st::settingsIconArrows, kIconLightBlue },
UserPrivacy::Key::CallsPeer2Peer, UserPrivacy::Key::CallsPeer2Peer,
[] { return std::make_unique<CallsPeer2PeerPrivacyController>(); }); [] { return std::make_unique<CallsPeer2PeerPrivacyController>(); },
&st::settingsButton);
AddSkip(content); AddSkip(content);
return result; return result;

View file

@ -814,14 +814,15 @@ void AddPrivacyButton(
rpl::producer<QString> label, rpl::producer<QString> label,
IconDescriptor &&descriptor, IconDescriptor &&descriptor,
Privacy::Key key, Privacy::Key key,
Fn<std::unique_ptr<EditPrivacyController>()> controllerFactory) { Fn<std::unique_ptr<EditPrivacyController>()> controllerFactory,
const style::SettingsButton *stOverride) {
const auto shower = Ui::CreateChild<rpl::lifetime>(container.get()); const auto shower = Ui::CreateChild<rpl::lifetime>(container.get());
const auto session = &controller->session(); const auto session = &controller->session();
AddButtonWithLabel( AddButtonWithLabel(
container, container,
std::move(label), std::move(label),
PrivacyString(session, key), PrivacyString(session, key),
st::settingsButtonNoIcon, stOverride ? *stOverride : st::settingsButtonNoIcon,
std::move(descriptor) std::move(descriptor)
)->addClickHandler([=] { )->addClickHandler([=] {
*shower = session->api().userPrivacy().value( *shower = session->api().userPrivacy().value(

View file

@ -32,7 +32,8 @@ void AddPrivacyButton(
rpl::producer<QString> label, rpl::producer<QString> label,
IconDescriptor &&descriptor, IconDescriptor &&descriptor,
Api::UserPrivacy::Key key, Api::UserPrivacy::Key key,
Fn<std::unique_ptr<EditPrivacyController>()> controllerFactory); Fn<std::unique_ptr<EditPrivacyController>()> controllerFactory,
const style::SettingsButton *stOverride = nullptr);
class PrivacySecurity : public Section<PrivacySecurity> { class PrivacySecurity : public Section<PrivacySecurity> {
public: public: