mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 08:05:12 +00:00
Added SpellingHighlighter to InputField in HistoryWidget and some boxes.
This commit is contained in:
@@ -78,6 +78,7 @@ private:
|
||||
QString _startLink;
|
||||
Fn<void(QString, QString)> _callback;
|
||||
Fn<void()> _setInnerFocus;
|
||||
base::unique_qptr<Spellchecker::SpellingHighlighter> _spelling;
|
||||
|
||||
};
|
||||
|
||||
@@ -127,6 +128,7 @@ void EditLinkBox::prepare() {
|
||||
getDelegate()->outerContainer(),
|
||||
text,
|
||||
_session);
|
||||
_spelling = InitSpellchecker(_session, text);
|
||||
|
||||
const auto url = content->add(
|
||||
object_ptr<Ui::InputField>(
|
||||
@@ -273,6 +275,17 @@ void InitMessageField(
|
||||
DefaultEditLinkCallback(&controller->session(), field));
|
||||
}
|
||||
|
||||
base::unique_qptr<Spellchecker::SpellingHighlighter> InitSpellchecker(
|
||||
not_null<Main::Session*> session,
|
||||
not_null<Ui::InputField*> field) {
|
||||
auto s = base::make_unique_q<Spellchecker::SpellingHighlighter>(
|
||||
field->rawTextEdit(),
|
||||
session->settings().spellcheckerEnabledValue(),
|
||||
field->documentContentsChanges());
|
||||
field->setExtendedContextMenu(s->contextMenuCreated());
|
||||
return s;
|
||||
}
|
||||
|
||||
bool HasSendText(not_null<const Ui::InputField*> field) {
|
||||
const auto &text = field->getTextWithTags().text;
|
||||
for (const auto ch : text) {
|
||||
|
Reference in New Issue
Block a user