diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-14 18:17:12 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-14 18:17:12 +0200 |
commit | 5a060b8dc81c6268eb0272a4a0711f2c1ddad9e1 (patch) | |
tree | 2b020181563f088772974f0fa4a7779122ebee98 /src/qt/rpcconsole.cpp | |
parent | b07ea7c74bc8ad338588421371dbdb02d5351496 (diff) |
RPC console: scroll to the end when user enters a command
- Ensures that the command and reply is visible
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 33b09952b7..51051f72f0 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -11,6 +11,7 @@ #include <QTextEdit> #include <QKeyEvent> #include <QUrl> +#include <QScrollBar> #include <boost/tokenizer.hpp> @@ -262,6 +263,8 @@ void RPCConsole::on_lineEdit_returnPressed() history.removeFirst(); // Set pointer to end of history historyPtr = history.size(); + // Scroll console view to end + scrollToEnd(); } } @@ -315,3 +318,9 @@ void RPCConsole::on_openDebugLogfileButton_clicked() { GUIUtil::openDebugLogfile(); } + +void RPCConsole::scrollToEnd() +{ + QScrollBar *scrollbar = ui->messagesWidget->verticalScrollBar(); + scrollbar->setValue(scrollbar->maximum()); +} |