From 7a7d9dc216ecf0bf7200666b479fb08c0edec834 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 10 Oct 2023 15:39:33 +0200 Subject: Replace QInputDialog with custom dialog for queries Recent commits allowed multi-line input while reusing the QInputDialog object already defined by Kristall. However, QInputDialog lacks a way to access its QPlainTextEdit directly, and therefore set the wrap mode. Since QInputDialog does no wrapping, it is inconvenient for writing a long text (think of social media sites such as BBS or Station). Therefore, a custom QDialog-derived class, namely QueryDialog, has been provided. --- src/browsertab.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/browsertab.cpp') diff --git a/src/browsertab.cpp b/src/browsertab.cpp index b64ab93..efb75c9 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -25,6 +25,7 @@ #include "kristall.hpp" #include "widgets/favouritepopup.hpp" #include "widgets/searchbox.hpp" +#include "widgets/querydialog.hpp" #include #include @@ -867,10 +868,8 @@ void BrowserTab::on_inputRequired(const QString &query, const bool is_sensitive) { this->network_timeout_timer.stop(); - QInputDialog dialog{this}; + QueryDialog dialog(this); - dialog.setInputMode(QInputDialog::TextInput); - dialog.setOption(QInputDialog::UsePlainTextEditForTextInput); dialog.setLabelText(query); if (is_sensitive) dialog.setTextEchoMode(QLineEdit::Password); -- cgit v1.2.3