correctly placed the spinnerSearch, adjusted FolderView hGap and vGap
This commit is contained in:
		@ -7,7 +7,7 @@ import org.hso.texturesyncclient.view.mainView.MainViewController
 | 
			
		||||
import org.hso.texturesyncclient.view.startupView.StartupView
 | 
			
		||||
import tornadofx.App
 | 
			
		||||
 | 
			
		||||
class Main: App(MainView::class){
 | 
			
		||||
class Main: App(StartupView::class){
 | 
			
		||||
 | 
			
		||||
    val controller = RootController()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -116,6 +116,10 @@ class RootController : Controller() {
 | 
			
		||||
        find(StartupView::class).replaceWith(MainView::class, sizeToScene = true, centerOnScreen = true)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 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"
 | 
			
		||||
 | 
			
		||||
@ -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))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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<String>) {
 | 
			
		||||
        var previewList = arrayListOf<GUIModel>()
 | 
			
		||||
 | 
			
		||||
        // 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
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user