# HG changeset patch # User Daniel J Sebald # Date 1375991550 14400 # Node ID 2527bc7200ee29eb343e0917128a184665775e67 # Parent 8b64a1fc3071521d790819049dcca73120ec7039 Only scroll history window if it is positioned at bottom. * history-dock-widget.cc (history_dock_widget::append_history): Scroll to bottom if slide bar value equals maximum. diff --git a/libgui/src/history-dock-widget.cc b/libgui/src/history-dock-widget.cc --- a/libgui/src/history-dock-widget.cc +++ b/libgui/src/history-dock-widget.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include "error.h" @@ -160,8 +161,16 @@ { QStringList lst = _history_model->stringList (); lst.append (hist_entry); + + QScrollBar *scroll_bar = _history_list_view->verticalScrollBar (); + + bool at_bottom = scroll_bar->maximum () - scroll_bar->value () < 1; + _history_model->setStringList (lst); - _history_list_view->scrollToBottom (); + + // Scroll if slider position at bottom. + if (at_bottom) + _history_list_view->scrollToBottom (); } void