diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-10 15:39:33 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-10 20:47:18 +0200 |
| commit | 7a7d9dc216ecf0bf7200666b479fb08c0edec834 (patch) | |
| tree | 30957e51979a26f5baaf54e0c3f193d9689fe92c /src/browsertab.cpp | |
| parent | 8cb79ee6711b3db3f138db6367752053f45efc17 (diff) | |
Replace QInputDialog with custom dialog for queriesquery-dialog
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.
Diffstat (limited to 'src/browsertab.cpp')
| -rw-r--r-- | src/browsertab.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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 <cassert> #include <QTabWidget> @@ -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); |
