Updated context menu for spellchecker.

This commit is contained in:
23rd 2020-02-21 12:48:24 +03:00
parent 8734ebe4c4
commit 0ca0930066
4 changed files with 8 additions and 1 deletions

View File

@ -1616,6 +1616,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_formatting_link_url" = "URL";
"lng_formatting_link_create" = "Create";
"lng_spellchecker_submenu" = "Spelling";
"lng_spellchecker_add" = "Add to Dictionary";
"lng_spellchecker_remove" = "Remove from Dictionary";
"lng_spellchecker_ignore" = "Ignore word";

View File

@ -282,7 +282,11 @@ void InitSpellchecker(
#ifndef TDESKTOP_DISABLE_SPELLCHECK
const auto s = Ui::CreateChild<Spellchecker::SpellingHighlighter>(
field.get(),
session->settings().spellcheckerEnabledValue());
session->settings().spellcheckerEnabledValue(),
Spellchecker::SpellingHighlighter::CustomContextMenuItem{
tr::lng_settings_manage_dictionaries(tr::now),
[=] { Ui::show(Box<Ui::ManageDictionariesBox>(session)); }
});
field->setExtendedContextMenu(s->contextMenuCreated());
#endif // TDESKTOP_DISABLE_SPELLCHECK
}

View File

@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/qt_connection.h"
#ifndef TDESKTOP_DISABLE_SPELLCHECK
#include "boxes/dictionaries_manager.h"
#include "spellcheck/spelling_highlighter.h"
#endif // TDESKTOP_DISABLE_SPELLCHECK

View File

@ -355,6 +355,7 @@ std::vector<int> DefaultLanguages() {
void Start(not_null<Main::Session*> session) {
Spellchecker::SetPhrases({ {
{ &ph::lng_spellchecker_submenu, tr::lng_spellchecker_submenu() },
{ &ph::lng_spellchecker_add, tr::lng_spellchecker_add() },
{ &ph::lng_spellchecker_remove, tr::lng_spellchecker_remove() },
{ &ph::lng_spellchecker_ignore, tr::lng_spellchecker_ignore() },