mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
[Qt] keep scroll position in GUI console after changing font size
This commit is contained in:
@@ -490,8 +490,10 @@ void RPCConsole::setFontSize(int newSize)
|
||||
settings.setValue(fontSizeSettingsKey, consoleFontSize);
|
||||
|
||||
// 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();
|
||||
ui->messagesWidget->setHtml(str);
|
||||
ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum());
|
||||
}
|
||||
|
||||
void RPCConsole::clear()
|
||||
|
||||
Reference in New Issue
Block a user