diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/window/Window.kt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt index b0a3cb7d..7dfeb921 100644 --- a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt +++ b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt @@ -167,7 +167,10 @@ open class Window( private val maximizeIcon = MaximizeIcon() private val minimizeIcon = MinimizeIcon() private val captionTag = Tag(TAG.H4, caption, classes = setOf("modal-title")) - private val windowIcon = Icon(icon ?: "").apply { addCssClass("window-icon") } + private val windowIcon = Icon(icon ?: "").apply { + addCssClass("window-icon") + visible = (icon != null && icon != "") + } private var isResizeEvent = false @@ -183,7 +186,8 @@ open class Window( zIndex = ++zIndexCounter closeIcon.visible = closeButton closeIcon.setEventListener { - click = { e -> + click = { _ -> + @Suppress("UnsafeCastFromDynamic") if (this@Window.dispatchEvent("closeWindow", obj {}) != false) { close() } @@ -195,7 +199,8 @@ open class Window( header.add(closeIcon) maximizeIcon.visible = maximizeButton maximizeIcon.setEventListener { - click = { e -> + click = { _ -> + @Suppress("UnsafeCastFromDynamic") if (this@Window.dispatchEvent("maximizeWindow", obj {}) != false) { toggleMaximize() } @@ -207,7 +212,8 @@ open class Window( header.add(maximizeIcon) minimizeIcon.visible = minimizeButton minimizeIcon.setEventListener { - click = { e -> + click = { _ -> + @Suppress("UnsafeCastFromDynamic") if (this@Window.dispatchEvent("minimizeWindow", obj {}) != false) { toggleMinimize() } |