diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-17 14:29:37 +0300 |
---|---|---|
committer | Jarol Rodriguez <jarolrod@tutanota.com> | 2021-04-22 22:30:12 -0400 |
commit | 7962e0dde8bbd0fa3dd702e2224774f1edaadcb6 (patch) | |
tree | ba48f090528b008f3d171e6c28ccf2f4933475df | |
parent | d2cc3390054616c73f72a59f864700f6de14067b (diff) | |
download | bitcoin-7962e0dde8bbd0fa3dd702e2224774f1edaadcb6.tar.xz |
qt: Do not clear console prompt when font resizing
-rw-r--r-- | src/qt/rpcconsole.cpp | 6 | ||||
-rw-r--r-- | src/qt/rpcconsole.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 378328d1b2..4fba7ccd04 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -776,15 +776,15 @@ void RPCConsole::setFontSize(int newSize) // clear console (reset icon sizes, default stylesheet) and re-add the content float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value(); - clear(); + clear(/* keep_prompt */ true); ui->messagesWidget->setHtml(str); ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum()); } -void RPCConsole::clear() +void RPCConsole::clear(bool keep_prompt) { ui->messagesWidget->clear(); - ui->lineEdit->clear(); + if (!keep_prompt) ui->lineEdit->clear(); ui->lineEdit->setFocus(); // Add smoothly scaled icon images. diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index b686154818..2f8cae6161 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -99,7 +99,7 @@ private Q_SLOTS: void updateDetailWidget(); public Q_SLOTS: - void clear(); + void clear(bool keep_prompt = false); void fontBigger(); void fontSmaller(); void setFontSize(int newSize); |