diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-01-30 00:10:48 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-01-30 00:10:48 +0100 |
commit | 20224268cfd05aefd935547e44dd938cf6e2e312 (patch) | |
tree | ad6d70b46ef76533ba0a6608f2da492fabaa0f9d /examples/showcase/src/main | |
parent | 7dde9ea19982d9e8ae2eca4eda61f9c4782d3a6d (diff) | |
download | kvision-20224268cfd05aefd935547e44dd938cf6e2e312.tar.gz kvision-20224268cfd05aefd935547e44dd938cf6e2e312.tar.bz2 kvision-20224268cfd05aefd935547e44dd938cf6e2e312.zip |
Small layout fixes
Diffstat (limited to 'examples/showcase/src/main')
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) } |