Browse Source

Merge #7668: Fix history deletion bug after font size change

21e45a0 Fix history deletion bug after font change (Andrew C)
0.13
Jonas Schnelli 9 years ago
parent
commit
b24266c207
No known key found for this signature in database
GPG Key ID: 29D4BCB6416F53EC
  1. 7
      src/qt/rpcconsole.cpp
  2. 2
      src/qt/rpcconsole.h

7
src/qt/rpcconsole.cpp

@ -503,16 +503,19 @@ void RPCConsole::setFontSize(int newSize)
// clear console (reset icon sizes, default stylesheet) and re-add the content // clear console (reset icon sizes, default stylesheet) and re-add the content
float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value(); float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value();
clear(); clear(false);
ui->messagesWidget->setHtml(str); ui->messagesWidget->setHtml(str);
ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum()); ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum());
} }
void RPCConsole::clear() void RPCConsole::clear(bool clearHistory)
{ {
ui->messagesWidget->clear(); ui->messagesWidget->clear();
if(clearHistory)
{
history.clear(); history.clear();
historyPtr = 0; historyPtr = 0;
}
ui->lineEdit->clear(); ui->lineEdit->clear();
ui->lineEdit->setFocus(); ui->lineEdit->setFocus();

2
src/qt/rpcconsole.h

@ -78,7 +78,7 @@ private Q_SLOTS:
void clearSelectedNode(); void clearSelectedNode();
public Q_SLOTS: public Q_SLOTS:
void clear(); void clear(bool clearHistory = true);
void fontBigger(); void fontBigger();
void fontSmaller(); void fontSmaller();
void setFontSize(int newSize); void setFontSize(int newSize);

Loading…
Cancel
Save