Fix build with Xcode.

This commit is contained in:
John Preston 2023-02-27 22:05:10 +04:00
parent ce0e07d332
commit a01f74ecdc
3 changed files with 6 additions and 2 deletions

View file

@ -563,7 +563,10 @@ template <typename Flags>
{ entry.icon }); { entry.icon });
const auto toggle = Ui::CreateChild<Ui::RpWidget>( const auto toggle = Ui::CreateChild<Ui::RpWidget>(
button.get()); button.get());
auto &lifetime = toggle->lifetime();
// Looks like a bug in Clang, fails to compile with 'auto&' below.
rpl::lifetime &lifetime = toggle->lifetime();
const auto checkView = lifetime.make_state<Ui::ToggleView>( const auto checkView = lifetime.make_state<Ui::ToggleView>(
st.toggle, st.toggle,
toggled, toggled,

View file

@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#pragma once #pragma once
#include "data/data_chat_participant_status.h" #include "data/data_chat_participant_status.h"
#include "base/object_ptr.h"
namespace style { namespace style {
struct SettingsButton; struct SettingsButton;

View file

@ -88,7 +88,7 @@ void PowerSavingBox(not_null<Ui::GenericBox*> box) {
disabler->setClickedCallback([=] { disabler->setClickedCallback([=] {
Ui::ShowMultilineToast({ Ui::ShowMultilineToast({
.parentOverride = container, .parentOverride = container,
.text = tr::lng_settings_power_turn_off(tr::now), .text = { tr::lng_settings_power_turn_off(tr::now) },
.duration = kForceDisableTooltipDuration, .duration = kForceDisableTooltipDuration,
}); });
}); });