Skip to content

Commit

Permalink
qt: Do not clear console prompt when font resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto authored and jarolrod committed Apr 23, 2021
1 parent d2cc339 commit 7962e0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7962e0d

Please sign in to comment.