aboutsummaryrefslogtreecommitdiff
path: root/examples/showcase
diff options
context:
space:
mode:
Diffstat (limited to 'examples/showcase')
-rw-r--r--examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt3
-rw-r--r--examples/showcase/src/main/kotlin/com/example/DataTab.kt6
-rw-r--r--examples/showcase/src/main/kotlin/com/example/Showcase.kt7
3 files changed, 10 insertions, 6 deletions
diff --git a/examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt b/examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt
index a09e005f..93f32694 100644
--- a/examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt
+++ b/examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt
@@ -6,6 +6,7 @@ import pl.treksoft.kvision.form.check.RADIOSTYLE
import pl.treksoft.kvision.form.check.Radio
import pl.treksoft.kvision.html.BUTTONSTYLE
import pl.treksoft.kvision.html.Button
+import pl.treksoft.kvision.panel.FLEXWRAP
import pl.treksoft.kvision.panel.HPanel
import pl.treksoft.kvision.panel.SimplePanel
import pl.treksoft.kvision.panel.VPanel
@@ -14,7 +15,7 @@ import pl.treksoft.kvision.utils.px
class ButtonsTab : SimplePanel() {
init {
this.marginTop = 10.px()
- val mainPanel = HPanel(spacing = 100)
+ val mainPanel = HPanel(wrap = FLEXWRAP.WRAP, spacing = 100)
val buttonsPanel = VPanel(spacing = 7)
buttonsPanel.add(Button("Default button", style = BUTTONSTYLE.DEFAULT).apply { width = 200.px() })
buttonsPanel.add(Button("Primary button", style = BUTTONSTYLE.PRIMARY).apply { width = 200.px() })
diff --git a/examples/showcase/src/main/kotlin/com/example/DataTab.kt b/examples/showcase/src/main/kotlin/com/example/DataTab.kt
index 177167c4..8a38e001 100644
--- a/examples/showcase/src/main/kotlin/com/example/DataTab.kt
+++ b/examples/showcase/src/main/kotlin/com/example/DataTab.kt
@@ -7,9 +7,7 @@ import pl.treksoft.kvision.form.check.CHECKBOXSTYLE
import pl.treksoft.kvision.form.check.CheckBox
import pl.treksoft.kvision.html.BUTTONSTYLE
import pl.treksoft.kvision.html.Button
-import pl.treksoft.kvision.panel.FLEXDIR
import pl.treksoft.kvision.panel.FLEXWRAP
-import pl.treksoft.kvision.panel.FlexPanel
import pl.treksoft.kvision.panel.HPanel
import pl.treksoft.kvision.panel.SimplePanel
import pl.treksoft.kvision.panel.VPanel
@@ -51,10 +49,10 @@ class DataTab : SimplePanel() {
list[index].checked = this.value
}
}
- }, child = FlexPanel(FLEXDIR.ROW, spacing = 10, wrap = FLEXWRAP.WRAP))
+ }, child = HPanel(spacing = 10, wrap = FLEXWRAP.WRAP))
panel.add(dataContainer)
- val butPanel = HPanel(spacing = 10)
+ val butPanel = HPanel(spacing = 10, wrap = FLEXWRAP.WRAP)
butPanel.add(Button("Add December", style = BUTTONSTYLE.SUCCESS).onClick {
list.add(DataModel(true, "December"))
})
diff --git a/examples/showcase/src/main/kotlin/com/example/Showcase.kt b/examples/showcase/src/main/kotlin/com/example/Showcase.kt
index 40a231e8..58367600 100644
--- a/examples/showcase/src/main/kotlin/com/example/Showcase.kt
+++ b/examples/showcase/src/main/kotlin/com/example/Showcase.kt
@@ -6,14 +6,19 @@ import pl.treksoft.kvision.core.Border
import pl.treksoft.kvision.core.COLOR
import pl.treksoft.kvision.core.Root
import pl.treksoft.kvision.panel.TabPanel
+import pl.treksoft.kvision.utils.auto
+import pl.treksoft.kvision.utils.perc
import pl.treksoft.kvision.utils.px
class Showcase : ApplicationBase() {
override fun start(state: Map<String, Any>) {
- val root = Root("showcase", true)
+ val root = Root("showcase")
val tabPanel = TabPanel().apply {
+ width = 80.perc()
margin = 20.px()
+ marginLeft = auto()
+ marginRight = auto()
padding = 20.px()
border = Border(2.px(), BORDERSTYLE.SOLID, COLOR.SILVER)
}