Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StdTheme is the theme all new ScrollBars get by default. StdTheme = NewTheme() )
Functions ¶
This section is empty.
Types ¶
type Pager ¶
type Pager interface { // LineScrollAmount is called to determine how far to scroll in the given direction to reveal // a full 'line' of content. A positive value should be returned regardless of the direction, // although negative values will behave as if they were positive. LineScrollAmount(horizontal, towardsStart bool) float64 // PageScrollAmount is called to determine how far to scroll in the given direction to reveal // a full 'page' of content. A positive value should be returned regardless of the direction, // although negative values will behave as if they were positive. PageScrollAmount(horizontal, towardsStart bool) float64 }
Pager objects can provide line and page information for scrolling.
type ScrollBar ¶
type ScrollBar struct { widget.Block Target Scrollable // The target of the scrollbar. Theme *Theme // The theme the scrollbar will use to draw itself. // contains filtered or unexported fields }
ScrollBar represents a widget for controlling scrolling.
func (*ScrollBar) SetScrolledPosition ¶
SetScrolledPosition attempts to set the current scrolled position of this ScrollBar to the specified value. The value will be clipped to the available range. If no target has been set, then nothing will happen.
type Scrollable ¶
type Scrollable interface { Pager // ScrolledPosition is called to determine the current position of the Scrollable. ScrolledPosition(horizontal bool) float64 // SetScrolledPosition is called to set the current position of the Scrollable. SetScrolledPosition(horizontal bool, position float64) // VisibleSize is called to determine the size of the visible portion of the Scrollable. VisibleSize(horizontal bool) float64 // ContentSize is called to determine the total size of the Scrollable. ContentSize(horizontal bool) float64 }
Scrollable objects can respond to ScrollBars.
type Theme ¶
type Theme struct { InitialRepeatDelay time.Duration // The amount of time to wait before triggering the first repeating event. RepeatDelay time.Duration // The amount of time to wait before triggering a repeating event. Background color.Color // The background color when enabled but not pressed or focused. BackgroundWhenPressed color.Color // The background color when enabled and pressed. MarkWhenLight color.Color // The color to use for control marks when the background is considered to be 'light'. MarkWhenDark color.Color // The color to use for control marks when the background is considered to be 'dark'. MarkWhenDisabled color.Color // The color to use for control marks when disabled. GradientAdjustment float64 // The amount to vary the color when creating the background gradient. DisabledAdjustment float64 // The amount to adjust the background brightness when disabled. OutlineAdjustment float64 // The amount to adjust the background brightness when using it to draw the button outline. Size float64 // The height of a horizontal scrollbar or the width of a vertical scrollbar. }
Theme contains the theme elements for ScrollBars.
Click to show internal directories.
Click to hide internal directories.