cljfx

https://github.com/cljfx/cljfx
2019-06-21T00:11:23.034900Z

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

2019-06-21T00:14:44.036100Z

well, the JFXTabPaneSkin seems based on TabPaneSkin so still might be the issue.

vlaaad 2019-06-21T06:58:55.036200Z

Yeah, seems like TabPaneSkin is buggy

vlaaad 2019-06-21T07:05:52.036400Z

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

2019-06-21T17:34:16.037200Z

@vlaaad I found this extra prop on Control useful: `

2019-06-21T17:34:28.037400Z

:skin (prop/make (mutator/setter (fn [^Skinnable control f]
                                         (.setSkin control (f control))))
                       lifecycle/scalar)

2019-06-21T17:35:54.038600Z

it lets you set the current skin as a function of the current control

2019-06-21T17:35:56.038800Z

eg.

2019-06-21T17:36:17.039300Z

(defn tab-pane-skin [control]
  (TabPaneSkin. control))
{:fx/type :tab-pane
 :skin tab-pane-skin
 ...}

vlaaad 2019-06-21T17:42:33.039400Z

You also can set skin using css (-fx-skin css property)

2019-06-21T19:18:41.039800Z

ah, easy thanks

2019-06-21T19:27:43.041Z

@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

vlaaad 2019-06-21T19:57:42.042100Z

@ambrosebs nice, I was thinking about changing list mutator to something like this for a while

vlaaad 2019-06-21T19:58:59.042900Z

I'll do some tests and hopefully we'll get this merged

2019-06-21T20:03:18.043500Z

@vlaaad I didn't think very hard in the implementation so I wouldn't be offended if you threw it out.

2019-06-21T20:03:39.043900Z

I'm also happy to do that work myself if you don't want to.

vlaaad 2019-06-21T20:10:26.044800Z

I found a bug in this implementation: it throws java.lang.IllegalArgumentException: Children: duplicate children added: parent = VBox@7adabc67

vlaaad 2019-06-21T20:11:19.045600Z

tried this PR on e09-todo-app example, exception occurs on checking the checkbox

2019-06-21T20:18:46.047200Z

ok thanks I can work on that

vlaaad 2019-06-21T20:36:08.048Z

I left a comment on this PR with my thoughts so it wont get lost here

2019-06-21T20:37:43.048800Z

great thanks! I'm at a loss about how to batch transactions with an Observable list since the begin/end transaction methods seem protected.

vlaaad 2019-06-21T20:41:20.049600Z

and final, yeah, I guess it's not possible to do many changes as single event

2019-06-21T20:42:48.050100Z

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

vlaaad 2019-06-21T20:45:46.051500Z

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 👍

2019-06-21T20:46:50.051800Z

ok, let's do that first