diff options
author | Robert Jaros <rjaros@finn.pl> | 2020-05-09 23:53:57 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2020-05-09 23:53:57 +0200 |
commit | 134cb687c4e05fd81a03b682505f9fb9d741a8d7 (patch) | |
tree | f9f41f28c01dc29d1d4fdd576cc9b21958fd9c3b /src/main/kotlin/pl/treksoft/kvision/panel/DockPanel.kt | |
parent | 4a2aa49e0e561c1bc25aa962449fa2fcce9207ba (diff) | |
download | kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.tar.gz kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.tar.bz2 kvision-134cb687c4e05fd81a03b682505f9fb9d741a8d7.zip |
Add new className parameter to all DSL builder functions.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/DockPanel.kt')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/DockPanel.kt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/DockPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/DockPanel.kt index 59c61637..52239032 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/DockPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/DockPanel.kt @@ -24,6 +24,7 @@ package pl.treksoft.kvision.panel import pl.treksoft.kvision.core.Component import pl.treksoft.kvision.core.Container import pl.treksoft.kvision.utils.perc +import pl.treksoft.kvision.utils.set /** * Dock layout directions. @@ -50,21 +51,25 @@ open class DockPanel(classes: Set<String> = setOf(), init: (DockPanel.() -> Unit * Internal property. */ protected var leftComponent: Component? = null + /** * @suppress * Internal property. */ protected var centerComponent: Component? = null + /** * @suppress * Internal property. */ protected var rightComponent: Component? = null + /** * @suppress * Internal property. */ protected var upComponent: Component? = null + /** * @suppress * Internal property. @@ -83,6 +88,7 @@ open class DockPanel(classes: Set<String> = setOf(), init: (DockPanel.() -> Unit @Suppress("MagicNumber") height = 100.perc } + /** * @suppress * Internal property. @@ -204,8 +210,12 @@ open class DockPanel(classes: Set<String> = setOf(), init: (DockPanel.() -> Unit * * It takes the same parameters as the constructor of the built component. */ -fun Container.dockPanel(classes: Set<String> = setOf(), init: (DockPanel.() -> Unit)? = null): DockPanel { - val dockPanel = DockPanel(classes, init) +fun Container.dockPanel( + classes: Set<String>? = null, + className: String? = null, + init: (DockPanel.() -> Unit)? = null +): DockPanel { + val dockPanel = DockPanel(classes ?: className.set, init) this.add(dockPanel) return dockPanel } |