2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Add file size limit to autoplay settings.

This commit is contained in:
John Preston
2019-12-24 13:09:04 +03:00
parent 8a3506af89
commit 616957e46f
15 changed files with 290 additions and 200 deletions

View File

@@ -452,41 +452,6 @@ void SetupPerformance(
not_null<Window::SessionController*> controller,
not_null<Ui::VerticalLayout*> container) {
SetupAnimations(container);
const auto session = &controller->session();
AddButton(
container,
tr::lng_settings_autoplay_gifs(),
st::settingsButton
)->toggleOn(
rpl::single(session->settings().autoplayGifs())
)->toggledValue(
) | rpl::filter([=](bool enabled) {
return (enabled != session->settings().autoplayGifs());
}) | rpl::start_with_next([=](bool enabled) {
session->settings().setAutoplayGifs(enabled);
if (!enabled) {
session->data().checkPlayingVideoFiles();
}
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(