globaltcad / swing-tree

A small DSL library for building Swing UIs
MIT License
6 stars 0 forks source link

Ignored background color #154

Open Mazi-S opened 2 weeks ago

Mazi-S commented 2 weeks ago

I've noticed that .withBackground does not work with some components. @Gleethos I guess it's not intentional?

Screenshot from 2024-08-27 16-32-20

of(this).withLayout("wrap 2", "", "[]5[]15[]5[]15[]5[]")
    .add(SPAN(2), label("panel"))
    .add(panel().withPrefSize(100, 50).withBackground(COLOR))
    .add(panel().withPrefSize(100, 50).withStyle(delegate -> delegate.backgroundColor(COLOR)))
    .add(SPAN(2), label("label"))
    .add(label("").withPrefSize(100, 50).withBackground(COLOR))
    .add(label("").withPrefSize(100, 50).withStyle(delegate -> delegate.backgroundColor(COLOR)))
    .add(SPAN(2), label("html"))
    .add(html("").withPrefSize(100, 50).withBackground(COLOR))
    .add(html("").withPrefSize(100, 50).withStyle(delegate -> delegate.backgroundColor(COLOR)));