Scoop API

scoop:scoop.ui.style:0.1.0

src/theme/scrollbar_builder.scoop

Selected production source · src/theme/scrollbar_builder.scoop

1package scoop.ui.style
3/** Constructs a complete description and applies configuration once. */
4public 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 = arrow
19 ),
20 configure
21 )
23internal fun configureScrollbarPart(
24 initial: ScrollbarPart,
25 configure: ScrollbarPartBuilder.() -> Unit
26): ScrollbarPart {
27 val builder = ScrollbarPartBuilder(initial)
28 builder.configure()
29 return builder.snapshot()
32/** Mutable configuration initialized from a complete immutable value. */
33public class ScrollbarPartBuilder internal constructor(initial: ScrollbarPart) {
34 public var metrics: ScrollbarMetrics = initial.metrics
35 public var track: StateColors = initial.track
36 public var thumb: StateColors = initial.thumb
37 public var button: StateColors = initial.button
38 public var arrow: StateColors = initial.arrow
39 public var arrowWidth: Double = initial.arrowWidth
41 internal fun snapshot(): ScrollbarPart =
42 ScrollbarPart(
43 metrics = metrics,
44 track = track,
45 thumb = thumb,
46 button = button,
47 arrow = arrow,
48 arrowWidth = arrowWidth
49 )