edvin / tornadofx-guide

TornadoFX Guide
133 stars 67 forks source link

Setting minWidth to -1 with TypeSafeCss is not initialized #102

Closed Mosch0512 closed 5 years ago

Mosch0512 commented 5 years ago

After doing the following in the TypeSafeCss kotlin code it wont be used. If i do the same inside an css file it will work.

minWidth = (-1).px

But if you open the Layout Debugger it is going to be used. Wrong

Code for Reproduction:

import tornadofx.*

class TestView : View("My View") {
    override val root =
            anchorpane {
                menubar {
                    menu("One Very Big Menu")
                    menu("Two Very Big Menu")
                    menu("Three Very Big Menu")
                }
            }
}

class TestApp : App(TestView::class, TestStyle::class)

class TestStyle : Stylesheet() {
    companion object {
        val menuButton by cssclass()
    }
    init {
        s(menuButton) {
            minWidth = (-1).px
        }
    }
}

TornadoFX Version: 1.7.18

Mosch0512 commented 5 years ago

Wrong Project moved to tornadofx#947