I guess `SVGPath(resources.text())` might work, ha...
# tornadofx
e
I guess
SVGPath(resources.text())
might work, havent tried though. We could add a constructor to SVGPath that accepts a source path as well. Let me know if it works, I can add it.
a
Like this ?
Copy code
SVGPath(resources.text("M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"))
e
No, if you already have the text inline, you'd just do
SVGPath("M3...
a
Copy code
item(icon = SVGPath("M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"), expanded = true) {
            add(PlaceHolderView::class)
        }
This is giving me error: Too many arguments for public constructor SVGPath()
@edvin
e
Sorry,
SVGPath().apply { content = "M3" }
a
Ok this worked but how can I style this icon using css?
like width height, colors and stuff
e
Basically it has all the properties of Shape and Node.
a
I am asking about how will I assign the css class name to this icon? As for others I use addClass("my-custom-class").
Copy code
val menuIcon= SVGPath().apply { content = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" }
    override val root = drawer {
        item(icon = menuIcon, expanded = true) {
            add(PlaceHolderView::class)
        }
e
Just the same way, using
addClass
? 🙂
SVGPath().apply { content = "M3"; addClass() }
a
ohhhkk. will give it a try