feat: add restart button to preferences

This commit is contained in:
ZavaruKitsu 2024-01-03 21:06:36 +03:00
parent e0c2294d50
commit b6bbf3a560
2 changed files with 15 additions and 1 deletions

View file

@ -49,6 +49,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_menu_icons.h"
#include "styles/style_layers.h"
// AyuGram includes
#include "ayu/ui/settings/settings_ayu.h"
namespace Info {
namespace {
@ -348,7 +352,8 @@ void WrapWidget::createTopBar() {
&& (section.settingsType()
== ::Settings::CloudPasswordEmailConfirmId()
|| section.settingsType() == ::Settings::Main::Id()
|| section.settingsType() == ::Settings::Chat::Id())) {
|| section.settingsType() == ::Settings::Chat::Id()
|| section.settingsType() == ::Settings::Ayu::Id())) {
addTopBarMenuButton();
} else if (section.type() == Section::Type::Downloads) {
auto &manager = Core::App().downloadManager();

View file

@ -32,6 +32,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QAction>
// AyuGram includes
#include "ayu/ui/settings/settings_ayu.h"
namespace Settings {
void FillMenu(
@ -56,6 +60,11 @@ void FillMenu(
tr::lng_settings_password_abort(tr::now),
[=] { api->cloudPassword().clearUnconfirmedPassword(); },
&st::menuIconCancel);
} else if (type == Ayu::Id()) {
addAction(
tr::lng_restart_button(tr::now),
[=] { Core::Restart(); },
&st::menuIconRestore);
} else {
const auto &list = Core::App().domain().accounts();
if (list.size() < Core::App().domain().maxAccounts()) {