]> uap-core.de Git - rssreader.git/commitdiff
fix hardcoded container type in createContainer
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 22 Jun 2025 17:16:31 +0000 (19:16 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 22 Jun 2025 17:16:31 +0000 (19:16 +0200)
ui-kotlin/src/main/kotlin/de/unixwork/ui/kotlin/Toplevel.kt
ui-kotlin/src/test/kotlin/de/unixwork/ui/kotlin/demo/Main.kt

index c412d69b13eaac25a97446342555800fb2b271ed..53e996cf9cb11cd67c5dbf420a2d958453a0f20a 100644 (file)
@@ -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,
index 2e61fc7ac5fac1e93ec4c54b9e4cee2434975b7d..4d2d57e114b3601abaa7e8bb77846d3a8bad92cb 100644 (file)
@@ -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")
             }
         }