I thought the problem might be the TabPaneSkin, but I tried this skin and it worked just as badly https://github.com/jfoenixadmin/JFoenix/blob/master/jfoenix/src/main/java/com/jfoenix/controls/JFXTabPane.java
well, the JFXTabPaneSkin seems based on TabPaneSkin so still might be the issue.
Yeah, seems like TabPaneSkin is buggy
Maybe just reimplementing tab pane from scratch using basic building blocks like h-boxes and v-boxes will be more reliable, though it may be harder to implement stuff like tab dragging
@vlaaad I found this extra prop on Control
useful:
`
:skin (prop/make (mutator/setter (fn [^Skinnable control f]
(.setSkin control (f control))))
lifecycle/scalar)
it lets you set the current skin as a function of the current control
eg.
(defn tab-pane-skin [control]
(TabPaneSkin. control))
{:fx/type :tab-pane
:skin tab-pane-skin
...}
You also can set skin using css (-fx-skin css property)
ah, easy thanks
@vlaaad I think I found a reliable fix for the TabPane issues. does this fix it for you? https://github.com/cljfx/cljfx/pull/25
@ambrosebs nice, I was thinking about changing list mutator to something like this for a while
I'll do some tests and hopefully we'll get this merged
@vlaaad I didn't think very hard in the implementation so I wouldn't be offended if you threw it out.
I'm also happy to do that work myself if you don't want to.
I found a bug in this implementation: it throws java.lang.IllegalArgumentException: Children: duplicate children added: parent = VBox@7adabc67
tried this PR on e09-todo-app
example, exception occurs on checking the checkbox
ok thanks I can work on that
I left a comment on this PR with my thoughts so it wont get lost here
great thanks! I'm at a loss about how to batch transactions with an Observable list since the begin/end transaction methods seem protected
.
and final, yeah, I guess it's not possible to do many changes as single event
if we want to fix this just for TabPane, there's a specific method for swapping tabs https://github.com/javafxports/openjdk-jfx/blob/develop/modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/TabObservableList.java#L46
yeah, having tabs fixed is also nice, if you'll make a PR with custom mutator for tabs, I'd consider it for cljfx too 👍
ok, let's do that first