2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Implement information settings section.

This commit is contained in:
John Preston
2018-09-09 20:38:08 +03:00
parent 633ff4b60e
commit bbe6d2d13b
26 changed files with 459 additions and 25 deletions

View File

@@ -387,6 +387,9 @@ void WrapWidget::createTopBar() {
} else if (section.type() == Section::Type::Settings
&& section.settingsType() == Section::SettingsType::Main) {
addTopBarMenuButton();
} else if (section.type() == Section::Type::Settings
&& section.settingsType() == Section::SettingsType::Information) {
addContentSaveButton();
}
_topBar->lower();
@@ -409,6 +412,23 @@ void WrapWidget::addTopBarMenuButton() {
});
}
void WrapWidget::addContentSaveButton() {
Expects(_topBar != nullptr);
_topBar->addButtonWithVisibility(
base::make_unique_q<Ui::IconButton>(
_topBar,
(wrap() == Wrap::Layer
? st::infoLayerTopBarSave
: st::infoTopBarSave)),
_controller->canSaveChanges()
)->addClickHandler([=] {
_content->saveChanges(crl::guard(_content.data(), [=] {
_controller->showBackFromStack();
}));
});
}
void WrapWidget::addProfileCallsButton() {
Expects(_topBar != nullptr);