add follow tail feature
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user