From: Olaf Wintermann Date: Sun, 22 Jun 2025 17:16:31 +0000 (+0200) Subject: fix hardcoded container type in createContainer X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=4fea27a624f1f4b11b93fb536b719d7fd36c2e9b;p=rssreader.git fix hardcoded container type in createContainer --- diff --git a/ui-kotlin/src/main/kotlin/de/unixwork/ui/kotlin/Toplevel.kt b/ui-kotlin/src/main/kotlin/de/unixwork/ui/kotlin/Toplevel.kt index c412d69..53e996c 100644 --- a/ui-kotlin/src/main/kotlin/de/unixwork/ui/kotlin/Toplevel.kt +++ b/ui-kotlin/src/main/kotlin/de/unixwork/ui/kotlin/Toplevel.kt @@ -25,7 +25,7 @@ class Toplevel(obj: UiObject) { } private fun createContainer( - builder: ContainerBuilder, + container: ContainerBuilder, fill: Boolean = false, hexpand: Boolean = false, vexpand: Boolean = false, @@ -46,7 +46,6 @@ class Toplevel(obj: UiObject) { rowspacing: Int = -1, ui: ContainerUI? = null ): UiWidget { - val container = Container.vbox(obj) if(hexpand) { container.hexpand(true) } @@ -112,7 +111,7 @@ class Toplevel(obj: UiObject) { ui: ContainerUI? = null ): UiWidget { return createContainer( - builder = Container.hbox(obj), + container = Container.hbox(obj), fill = fill, hexpand = hexpand, vexpand = vexpand, @@ -146,7 +145,7 @@ class Toplevel(obj: UiObject) { ui: ContainerUI? = null ): UiWidget { return createContainer( - builder = Container.vbox(obj), + container = Container.vbox(obj), fill = fill, hexpand = hexpand, vexpand = vexpand, @@ -186,7 +185,7 @@ class Toplevel(obj: UiObject) { ui: ContainerUI? = null ): UiWidget { return createContainer( - builder = Container.grid(obj), + container = Container.grid(obj), fill = fill, hexpand = hexpand, vexpand = vexpand, diff --git a/ui-kotlin/src/test/kotlin/de/unixwork/ui/kotlin/demo/Main.kt b/ui-kotlin/src/test/kotlin/de/unixwork/ui/kotlin/demo/Main.kt index 2e61fc7..4d2d57e 100644 --- a/ui-kotlin/src/test/kotlin/de/unixwork/ui/kotlin/demo/Main.kt +++ b/ui-kotlin/src/test/kotlin/de/unixwork/ui/kotlin/demo/Main.kt @@ -11,19 +11,13 @@ class Main : Application { override fun startup() { val window = window("Test Window") { hbox { + button("T1") + button("T2") vbox { - button(label = "Hello World") { - println("Button Clicked") - } - button(label = "Hello World") { - println("Button Clicked") - } - } - vbox { - button(label = "Hello World") { - println("Button Clicked") - } + button("V1") + button("V2") } + button("T3") } }