panemu / tiwulfx-dock

MIT License
42 stars 12 forks source link

Dragging tabs around can cause empty regions #20

Open Martmists-GH opened 2 months ago

Martmists-GH commented 2 months ago

Code:

class MainApplication : Application() {
    override fun start(stage: Stage) {
        val root = DetachableTabPane()
        val scene = Scene(root)

        (0..3).forEach {
            root.tabs.add(DetachableTab("Tab $it").apply {
                content = Text("Content $it")
            })
        }

        stage.scene = scene
        stage.show()
    }
}

After playing around with it a bit, the application somehow ended up like this:

image

Martmists-GH commented 2 months ago

After experimenting for a bit, it seems to be caused by moving the topmost/leftmost tab of a row/column.

image

jingglang commented 2 months ago

Please try to set the DetachableTabPane.setCloseIfEmpty(true).