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

Add folders menu to Settings.

This commit is contained in:
John Preston
2020-03-18 14:07:11 +04:00
parent 4881981cf6
commit ffc65f7da4
13 changed files with 54 additions and 5 deletions

View File

@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/info_memento.h"
#include "info/info_controller.h"
#include "settings/settings_common.h"
#include "boxes/filters/manage_filters_box.h"
#include "ui/ui_utility.h"
namespace Info {
@@ -44,17 +45,26 @@ Widget::Widget(
, _self(controller->key().settingsSelf())
, _type(controller->section().settingsType())
, _inner(setInnerWidget(::Settings::CreateSection(
_type,
this,
controller->parentController()))) {
_type,
this,
controller->parentController())))
, _manageFilters(
std::make_unique<ManageFiltersPrepare>(
controller->parentController())) {
_inner->sectionShowOther(
) | rpl::start_with_next([=](Type type) {
controller->showSettings(type);
if (type == Type::Folders) {
_manageFilters->showBox();
} else {
controller->showSettings(type);
}
}, _inner->lifetime());
controller->setCanSaveChanges(_inner->sectionCanSaveChanges());
}
Widget::~Widget() = default;
not_null<UserData*> Widget::self() const {
return _self;
}