scoop:scoop.window:0.1.0
src/window_attributes_builder.scoop
Selected production source · src/window_attributes_builder.scoop
1
package scoop.window3
/** Configures one complete value; execution remains explicit. */4
public fun windowAttributes(configure: WindowAttributesBuilder.() -> Unit = {}): WindowAttributes {5
val builder = WindowAttributesBuilder()6
builder.configure()7
return builder.snapshot()8
}10
public fun WindowAttributes.copy(11
configure: WindowAttributesBuilder.() -> Unit = {}12
): WindowAttributes {13
val builder = WindowAttributesBuilder()14
builder.title = this.title15
builder.size = this.size16
builder.visible = this.visible17
builder.frame = this.frame18
builder.resizable = this.resizable19
builder.transparent = this.transparent20
builder.requestActivation = this.requestActivation21
builder.constraints = this.constraints22
builder.position = this.position23
builder.resizeIncrements = this.resizeIncrements24
builder.buttons = this.buttons25
builder.level = this.level26
builder.theme = this.theme27
builder.blur = this.blur28
builder.contentProtected = this.contentProtected29
builder.shadow = this.shadow30
builder.relation = this.relation31
builder.role = this.role32
builder.titlebarFlags = this.titlebarFlags33
builder.configure()34
return builder.snapshot()35
}37
public class WindowAttributesBuilder internal constructor() {38
internal var titlebarFlags: Int = 039
public var title: String = "Scoop"40
public var size: LogicalSize = LogicalSize(800.0, 600.0)41
public var visible: Boolean = true42
public var frame: WindowFrame = WindowFrame.System(WindowContentMode.Standard)43
public var resizable: Boolean = true44
public var transparent: Boolean = false45
public var requestActivation: Boolean = true46
public var constraints: WindowSizeConstraints = WindowSizeConstraints()47
public var position: DesktopPosition? = None48
public var resizeIncrements: LogicalSize? = None49
public var buttons: WindowButtons = WindowButtons()50
public var level: WindowLevel = WindowLevel.Normal51
public var theme: Theme? = None52
public var blur: Boolean = false53
public var contentProtected: Boolean = false54
public var shadow: WindowShadow = WindowShadow.System55
public var relation: WindowRelation = WindowRelation.Independent56
public var role: WindowRole = WindowRole.Normal57
internal fun snapshot(): WindowAttributes =58
WindowAttributes(59
title,60
size,61
visible,62
frame,63
resizable,64
transparent,65
requestActivation,66
constraints,67
position,68
resizeIncrements,69
buttons,70
level,71
theme,72
blur,73
contentProtected,74
shadow,75
relation,76
role,77
titlebarFlags78
)79
}