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(),
{ &st::settingsIconArrows, kIconLightBlue },
UserPrivacy::Key::CallsPeer2Peer,
[] { return std::make_unique<CallsPeer2PeerPrivacyController>(); });
[] { return std::make_unique<CallsPeer2PeerPrivacyController>(); },
&st::settingsButton);
AddSkip(content);
return result;

View File

@ -814,14 +814,15 @@ void AddPrivacyButton(
rpl::producer<QString> label,
IconDescriptor &&descriptor,
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 session = &controller->session();
AddButtonWithLabel(
container,
std::move(label),
PrivacyString(session, key),
st::settingsButtonNoIcon,
stOverride ? *stOverride : st::settingsButtonNoIcon,
std::move(descriptor)
)->addClickHandler([=] {
*shower = session->api().userPrivacy().value(

View File

@ -32,7 +32,8 @@ void AddPrivacyButton(
rpl::producer<QString> label,
IconDescriptor &&descriptor,
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> {
public: