TerminalScrollbarGeometry class

GtkAdjustment / VTE scrollbar math for TerminalHistoryScrollbar.

VTE model (vte_terminal + GtkAdjustment):

  • upper = total lines in buffer (history_size + viewport_rows)
  • page_size = visible rows (viewport_rows)
  • value0, `history_size` where value = display_offset (+ fraction)
  • value == 0 → live bottom; thumb sits at the bottom of the track
  • value == history_size → top of scrollback; thumb at the top of the track
  • thumb height ratio = page_size / upper

Constructors

TerminalScrollbarGeometry({required int historySize, required int viewportRows, required double scrollOffsetLines, required double trackHeight, double minThumbFraction = 0.08})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
historySize int
final
minThumbFraction double
final
positionFraction double
Gtk value / (upper - page_size) inverted for thumb placement: 1.0 = live bottom (thumb at track bottom), 0.0 = history top.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollOffsetLines double
final
thumbFraction double
no setter
thumbHeight double
no setter
thumbTop double
no setter
trackHeight double
final
viewportRows int
final
visible bool
no setter

Methods

isNearHistoryTop(double positionFraction) bool
isNearLiveBottom(double positionFraction) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scrollOffsetForPosition(double positionFraction) double
Gtk value from positionFraction.
thumbTopAt(double fraction) double
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

positionFractionFromTrackDy({required double localDy, required double trackHeight, required double thumbHeight}) double
Map pointer Y on the track to positionFraction (NOT inverted).

Constants

edgeSnapFraction → const double
Snap to scrollToBottom/scrollToTop when within this fraction of an edge.