aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/panel
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt6
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/Root.kt6
2 files changed, 5 insertions, 7 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt
index 310d4d49..010f7cba 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/FlexPanel.kt
@@ -24,7 +24,7 @@ package pl.treksoft.kvision.panel
import pl.treksoft.kvision.core.Component
import pl.treksoft.kvision.core.Container
import pl.treksoft.kvision.core.StringPair
-import pl.treksoft.kvision.core.StyledComponent
+import pl.treksoft.kvision.core.Widget
import pl.treksoft.kvision.core.WidgetWrapper
import pl.treksoft.kvision.utils.px
@@ -152,10 +152,10 @@ open class FlexPanel(
}
private fun refreshSpacing() {
- getChildren().filterIsInstance<StyledComponent>().map { applySpacing(it) }
+ getChildren().filterIsInstance<Widget>().map { applySpacing(it) }
}
- private fun applySpacing(wrapper: StyledComponent): StyledComponent {
+ private fun applySpacing(wrapper: Widget): Widget {
wrapper.marginTop = null
wrapper.marginRight = null
wrapper.marginBottom = null
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
index dd3d39b6..2d9dcc46 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/Root.kt
@@ -71,7 +71,6 @@ class Root(
}
roots.add(this)
if (isFirstRoot) {
- Style.styles.forEach { it.parent = this }
Modal.modals.forEach { it.parent = this }
}
@Suppress("LeakingThis")
@@ -102,9 +101,8 @@ class Root(
private fun stylesVNodes(): Array<VNode> {
return if (isFirstRoot) {
- val visibleStyles = Style.styles.filter { it.visible }
- if (visibleStyles.isNotEmpty()) {
- val stylesDesc = visibleStyles.joinToString("\n") { it.generateStyle() }
+ if (Style.styles.isNotEmpty()) {
+ val stylesDesc = Style.styles.joinToString("\n") { it.generateStyle() }
arrayOf(h("style", arrayOf(stylesDesc)))
} else {
arrayOf()