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