diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt b/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt index 88d25a9..6bdc16c 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/controller/Controller.kt @@ -123,6 +123,10 @@ class RootController : Controller() { } } + /** + * save the texture file to a local directory + * @param data the texture as meta element + */ fun exportTexture(data: Texture) { val directoryChooser = DirectoryChooser() directoryChooser.title = "Export Verzeichnis wählen" diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/FolderView.kt b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/FolderView.kt index 673f041..f878dd0 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/FolderView.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/FolderView.kt @@ -10,11 +10,11 @@ import tornadofx.* class FolderView : View("FolderView"){ override val root = flowpane { - hgap = 10.0 - vgap = 10.0 - paddingAll = 5.0 + hgap = 15.0 + vgap = 15.0 + paddingAll = 12.0 prefWidth = 732.0 - prefHeight = 1000.0 + prefHeight = 401.0 background = Background(BackgroundFill(Paint.valueOf("#cfcfcf"), CornerRadii.EMPTY, Insets.EMPTY)) //background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY)) diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainView.kt b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainView.kt index 2bcc874..052cc6e 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainView.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainView.kt @@ -3,6 +3,7 @@ package org.hso.texturesyncclient.view.mainView import com.jfoenix.controls.JFXChipView import com.jfoenix.controls.JFXSpinner import javafx.geometry.Insets +import javafx.scene.control.ScrollPane import javafx.scene.layout.Background import javafx.scene.layout.BackgroundFill @@ -26,17 +27,29 @@ class MainView : View() { maxHeight = 500.0 left = vbox { - prefWidth = 750.0 + background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY)) add(cvSearch) - scrollpane { - add(folderView.root) + anchorpane { + scrollpane { + this.fitToParentSize() + this.vbarPolicy = ScrollPane.ScrollBarPolicy.ALWAYS + add(folderView.root) + } + add(spinnerSearch) } + } right = detailView.root style { spinnerSearch.isVisible = false + spinnerSearch.anchorpaneConstraints { + topAnchor = 150 + bottomAnchor = 150 + leftAnchor = 150 + rightAnchor = 150 + } cvSearch.paddingAll = 7.0 cvSearch.minHeight = 70.0 diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainViewController.kt b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainViewController.kt index a489d74..b30a3c9 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainViewController.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/MainViewController.kt @@ -55,37 +55,11 @@ class MainViewController : Controller() { println(cvTags.chips) } - - /** - * save the texture file to r - * @param data the file as a byte array - * @param name name for the file - * @param format specific file format. jpeg or png - */ - fun exportTexture(data: ByteArray, name: String, format : TextureFormat){ - - - val directoryChooser = DirectoryChooser() - - directoryChooser.title = "Export Verzeichnis wählen" - - // TODO directoryChooser.setInitialDirectory(new File(System.getProperty("user.home"))) - - val dir = directoryChooser.showDialog(primaryStage) - - if (dir != null) { - - //copy data (bytesarray) with name and extension to dir - - } - } - fun cvSearchAction(tags: ObservableList) { var previewList = arrayListOf() // show spinner, block ui folderView.children.clear() - folderView.children.add(mv.spinnerSearch) mv.spinnerSearch.isVisible = true mv.cvSearch.isDisable = true @@ -93,7 +67,6 @@ class MainViewController : Controller() { previewList = rootc.search(tags) } ui { // when search finished - folderView.children.clear() addAllElements(previewList) mv.spinnerSearch.isVisible = false mv.cvSearch.isDisable = false