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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user