From 736b80835f67c9c34657074ebcfbe0752bef1c18 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 17 Oct 2019 21:58:34 +0200 Subject: Move DSL builder functions out of the companion objects (#93) --- .../kotlin/pl/treksoft/kvision/panel/StackPanel.kt | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt') diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt index 37dd449b..26bfcb8c 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt @@ -118,18 +118,18 @@ open class StackPanel( companion object { internal var counter = 0 - - /** - * DSL builder extension function. - * - * It takes the same parameters as the constructor of the built component. - */ - fun Container.stackPanel( - activateLast: Boolean = true, classes: Set = setOf(), init: (StackPanel.() -> Unit)? = null - ): StackPanel { - val stackPanel = StackPanel(activateLast, classes, init) - this.add(stackPanel) - return stackPanel - } } } + +/** + * DSL builder extension function. + * + * It takes the same parameters as the constructor of the built component. + */ +fun Container.stackPanel( + activateLast: Boolean = true, classes: Set = setOf(), init: (StackPanel.() -> Unit)? = null +): StackPanel { + val stackPanel = StackPanel(activateLast, classes, init) + this.add(stackPanel) + return stackPanel +} -- cgit