2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Refactored adding of sensitive menu items.

This commit is contained in:
23rd
2022-04-04 17:15:45 +03:00
parent 4754a513aa
commit 55864edb67
9 changed files with 60 additions and 36 deletions

View File

@@ -249,7 +249,7 @@ void FillMenu(
not_null<Window::SessionController*> controller,
Type type,
Fn<void(Type)> showOther,
MenuCallback addAction) {
Menu::MenuCallback addAction) {
const auto window = &controller->window();
if (type == Chat::Id()) {
addAction(
@@ -269,11 +269,12 @@ void FillMenu(
[=] { showOther(Information::Id()); },
&st::menuIconInfo);
}
const auto logout = addAction(
tr::lng_settings_logout(tr::now),
[=] { window->showLogoutConfirmation(); },
&st::menuIconLeaveAttention);
logout->setData(st::menuIconAttentionColor->c);
addAction({
.text = tr::lng_settings_logout(tr::now),
.handler = [=] { window->showLogoutConfirmation(); },
.icon = &st::menuIconLeaveAttention,
.isAttention = true,
});
}
}