scoop:scoop.ui.style:0.1.0
src/theme/scrollbar_builder.scoop
Selected production source · src/theme/scrollbar_builder.scoop
1
package scoop.ui.style3
/** Constructs a complete description and applies configuration once. */4
public fun scrollbarPart(5
metrics: ScrollbarMetrics,6
track: StateColors,7
thumb: StateColors,8
button: StateColors,9
arrow: StateColors,10
configure: ScrollbarPartBuilder.() -> Unit = {}11
): ScrollbarPart =12
configureScrollbarPart(13
ScrollbarPart(14
metrics = metrics,15
track = track,16
thumb = thumb,17
button = button,18
arrow = arrow19
),20
configure21
)23
internal fun configureScrollbarPart(24
initial: ScrollbarPart,25
configure: ScrollbarPartBuilder.() -> Unit26
): ScrollbarPart {27
val builder = ScrollbarPartBuilder(initial)28
builder.configure()29
return builder.snapshot()30
}32
/** Mutable configuration initialized from a complete immutable value. */33
public class ScrollbarPartBuilder internal constructor(initial: ScrollbarPart) {34
public var metrics: ScrollbarMetrics = initial.metrics35
public var track: StateColors = initial.track36
public var thumb: StateColors = initial.thumb37
public var button: StateColors = initial.button38
public var arrow: StateColors = initial.arrow39
public var arrowWidth: Double = initial.arrowWidth41
internal fun snapshot(): ScrollbarPart =42
ScrollbarPart(43
metrics = metrics,44
track = track,45
thumb = thumb,46
button = button,47
arrow = arrow,48
arrowWidth = arrowWidth49
)50
}