add follow tail feature

This commit is contained in:
2022-09-18 16:08:41 +02:00
parent 2d414442e5
commit b2db955e9e
2 changed files with 24 additions and 5 deletions

View File

@@ -18,6 +18,9 @@ class ScaledScrollBar(QScrollBar):
code involved. We work around this by converting the python int
into a string."""
scrolled_to_end = Signal(bool)
"""Signal emitted when the scroll bar value is set."""
def __init__(self):
super(ScaledScrollBar, self).__init__()
self.real_maximum = self.maximum()
@@ -46,6 +49,7 @@ class ScaledScrollBar(QScrollBar):
super().setMaximum(maximum)
def _valueChanged(self, value: int):
self.scrolled_to_end.emit(value == self.maximum() and value > 0)
if self.is_huge:
real_value = (value / self.maximum()) * self.real_maximum
# print("scaled value changed: %d -> %d (%f)" % (value, real_value, value / self.maximum()))