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

Forbid auto-night mode with theme editor.

This commit is contained in:
John Preston
2020-07-24 10:01:37 +04:00
parent 9a186cd8ce
commit 511067981d
4 changed files with 20 additions and 2 deletions

View File

@@ -880,6 +880,11 @@ void MainMenu::refreshMenu() {
_nightThemeAction = std::make_shared<QPointer<QAction>>();
auto action = _menu->addAction(tr::lng_menu_night_mode(tr::now), [=] {
if (Window::Theme::Background()->editingTheme()) {
Ui::show(Box<InformBox>(
tr::lng_theme_editor_cant_change_theme(tr::now)));
return;
}
const auto weak = MakeWeak(this);
const auto toggle = [=] {
if (!weak) {