From a67fcb81f1a53ead436ccabaf0f671522dfbfc0e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 Jan 2022 09:39:32 +0530 Subject: [PATCH] Ensure jobs log viewer stay at bottom when appending --- src/calibre/gui2/jobs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/jobs.py b/src/calibre/gui2/jobs.py index 18547aa3df..9c1a0811ca 100644 --- a/src/calibre/gui2/jobs.py +++ b/src/calibre/gui2/jobs.py @@ -489,7 +489,11 @@ class DetailView(Dialog): # {{{ more = f.read() self.next_pos = f.tell() if more: + v = self.log.verticalScrollBar() + atbottom = v.value() >= v.maximum() - 1 self.log.appendPlainText(more.decode('utf-8', 'replace')) + if atbottom: + v.setValue(v.maximum()) # }}}