aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-01-23 00:05:14 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2016-01-23 00:05:14 +0100
commit56c9e66a6d7c798394478660f6088b943fe4e96d (patch)
treef619dc0e19e0c834d0d3b15ce47d9ce3b24d1464
parent3a3a9273255f1caa68c96c327489938f7f310806 (diff)
[Qt] keep scroll position in GUI console after changing font size
-rw-r--r--src/qt/forms/debugwindow.ui4
-rw-r--r--src/qt/rpcconsole.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui
index 045eb80d95..2f46130990 100644
--- a/src/qt/forms/debugwindow.ui
+++ b/src/qt/forms/debugwindow.ui
@@ -480,7 +480,7 @@
</size>
</property>
<property name="toolTip">
- <string>Decrease Font Size</string>
+ <string>Decrease font size</string>
</property>
<property name="text">
<string/>
@@ -512,7 +512,7 @@
</size>
</property>
<property name="toolTip">
- <string>Increase Font Size</string>
+ <string>Increase font size</string>
</property>
<property name="text">
<string/>
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 40c54225f5..dca34ed043 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -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()