Skip to content

Commit 4c4d346

Browse files
committed
fix: 悬浮日志窗口自动滚动到底部
append_log 和 set_log_html 后自动将滚动条设到底部
1 parent 96991d8 commit 4c4d346

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

aao/ui/floating_log_window.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,15 @@ def set_status(self, state: str, attempt: str, round_text: str, last_text: str)
218218

219219
def set_log_html(self, html: str) -> None:
220220
self.txt_log.setHtml(html)
221+
self.txt_log.verticalScrollBar().setValue(
222+
self.txt_log.verticalScrollBar().maximum()
223+
)
221224

222225
def append_log(self, html: str) -> None:
223226
self.txt_log.append(html)
227+
self.txt_log.verticalScrollBar().setValue(
228+
self.txt_log.verticalScrollBar().maximum()
229+
)
224230

225231
def eventFilter(self, obj: QObject, event: QEvent) -> bool:
226232
if obj is self.lbl_status:

0 commit comments

Comments
 (0)