2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Add a separate setting for video files autoplay.

This commit is contained in:
John Preston
2019-12-19 14:48:40 +03:00
parent 041670b8e7
commit c4319a7370
6 changed files with 36 additions and 4 deletions

View File

@@ -470,6 +470,23 @@ void SetupPerformance(
}
session->saveSettingsDelayed();
}, container->lifetime());
AddButton(
container,
tr::lng_settings_autoplay_videos(),
st::settingsButton
)->toggleOn(
rpl::single(session->settings().autoplayVideos())
)->toggledValue(
) | rpl::filter([=](bool enabled) {
return (enabled != session->settings().autoplayVideos());
}) | rpl::start_with_next([=](bool enabled) {
session->settings().setAutoplayVideos(enabled);
if (!enabled) {
session->data().checkPlayingVideoFiles();
}
session->saveSettingsDelayed();
}, container->lifetime());
}
void SetupSystemIntegration(