2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Redesign auto download box.

This commit is contained in:
John Preston
2018-12-06 19:47:28 +04:00
parent 8e54ac4dcf
commit a0c6104fae
19 changed files with 298 additions and 219 deletions

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "settings/settings_common.h"
#include "boxes/connection_box.h"
#include "boxes/auto_download_box.h"
#include "boxes/stickers_box.h"
#include "boxes/background_box.h"
#include "boxes/download_path_box.h"
@@ -616,20 +617,35 @@ void SetupDataStorage(not_null<Ui::VerticalLayout*> container) {
}, ask->lifetime());
AddButton(
container,
lng_media_auto_settings,
st::settingsButton
)->addClickHandler([] {
Ui::show(Box<AutoDownloadBox>());
});
SetupLocalStorage(container);
SetupExport(container);
AddSkip(container, st::settingsCheckboxesSkip);
}
void SetupAutoDownload(not_null<Ui::VerticalLayout*> container) {
AddDivider(container);
AddSkip(container);
AddSubsectionTitle(container, lng_media_auto_settings);
using Source = Data::AutoDownload::Source;
const auto add = [&](LangKey label, Source source) {
AddButton(
container,
label,
st::settingsButton
)->addClickHandler([=] {
Ui::show(Box<AutoDownloadBox>(source));
});
};
add(lng_media_auto_in_private, Source::User);
add(lng_media_auto_in_groups, Source::Group);
add(lng_media_auto_in_channels, Source::Channel);
AddSkip(container, st::settingsCheckboxesSkip);
}
void SetupChatBackground(not_null<Ui::VerticalLayout*> container) {
AddDivider(container);
AddSkip(container);