correctly placed the spinnerSearch, adjusted FolderView hGap and vGap
This commit is contained in:
parent
c80233155f
commit
53dcebecde
@ -7,7 +7,7 @@ import org.hso.texturesyncclient.view.mainView.MainViewController
|
|||||||
import org.hso.texturesyncclient.view.startupView.StartupView
|
import org.hso.texturesyncclient.view.startupView.StartupView
|
||||||
import tornadofx.App
|
import tornadofx.App
|
||||||
|
|
||||||
class Main: App(MainView::class){
|
class Main: App(StartupView::class){
|
||||||
|
|
||||||
val controller = RootController()
|
val controller = RootController()
|
||||||
|
|
||||||
|
@ -116,6 +116,10 @@ class RootController : Controller() {
|
|||||||
find(StartupView::class).replaceWith(MainView::class, sizeToScene = true, centerOnScreen = true)
|
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) {
|
fun exportTexture(data: Texture) {
|
||||||
val directoryChooser = DirectoryChooser()
|
val directoryChooser = DirectoryChooser()
|
||||||
directoryChooser.title = "Export Verzeichnis wählen"
|
directoryChooser.title = "Export Verzeichnis wählen"
|
||||||
|
@ -10,11 +10,11 @@ import tornadofx.*
|
|||||||
class FolderView : View("FolderView"){
|
class FolderView : View("FolderView"){
|
||||||
|
|
||||||
override val root = flowpane {
|
override val root = flowpane {
|
||||||
hgap = 10.0
|
hgap = 15.0
|
||||||
vgap = 10.0
|
vgap = 15.0
|
||||||
paddingAll = 5.0
|
paddingAll = 12.0
|
||||||
prefWidth = 732.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("#cfcfcf"), CornerRadii.EMPTY, Insets.EMPTY))
|
||||||
//background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), 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.JFXChipView
|
||||||
import com.jfoenix.controls.JFXSpinner
|
import com.jfoenix.controls.JFXSpinner
|
||||||
import javafx.geometry.Insets
|
import javafx.geometry.Insets
|
||||||
|
import javafx.scene.control.ScrollPane
|
||||||
|
|
||||||
import javafx.scene.layout.Background
|
import javafx.scene.layout.Background
|
||||||
import javafx.scene.layout.BackgroundFill
|
import javafx.scene.layout.BackgroundFill
|
||||||
@ -26,17 +27,29 @@ class MainView : View() {
|
|||||||
maxHeight = 500.0
|
maxHeight = 500.0
|
||||||
|
|
||||||
left = vbox {
|
left = vbox {
|
||||||
prefWidth = 750.0
|
background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY))
|
||||||
add(cvSearch)
|
add(cvSearch)
|
||||||
|
anchorpane {
|
||||||
scrollpane {
|
scrollpane {
|
||||||
|
this.fitToParentSize()
|
||||||
|
this.vbarPolicy = ScrollPane.ScrollBarPolicy.ALWAYS
|
||||||
add(folderView.root)
|
add(folderView.root)
|
||||||
}
|
}
|
||||||
|
add(spinnerSearch)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
right = detailView.root
|
right = detailView.root
|
||||||
|
|
||||||
style {
|
style {
|
||||||
spinnerSearch.isVisible = false
|
spinnerSearch.isVisible = false
|
||||||
|
spinnerSearch.anchorpaneConstraints {
|
||||||
|
topAnchor = 150
|
||||||
|
bottomAnchor = 150
|
||||||
|
leftAnchor = 150
|
||||||
|
rightAnchor = 150
|
||||||
|
}
|
||||||
|
|
||||||
cvSearch.paddingAll = 7.0
|
cvSearch.paddingAll = 7.0
|
||||||
cvSearch.minHeight = 70.0
|
cvSearch.minHeight = 70.0
|
||||||
|
@ -55,37 +55,11 @@ class MainViewController : Controller() {
|
|||||||
println(cvTags.chips)
|
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>) {
|
fun cvSearchAction(tags: ObservableList<String>) {
|
||||||
var previewList = arrayListOf<GUIModel>()
|
var previewList = arrayListOf<GUIModel>()
|
||||||
|
|
||||||
// show spinner, block ui
|
// show spinner, block ui
|
||||||
folderView.children.clear()
|
folderView.children.clear()
|
||||||
folderView.children.add(mv.spinnerSearch)
|
|
||||||
mv.spinnerSearch.isVisible = true
|
mv.spinnerSearch.isVisible = true
|
||||||
mv.cvSearch.isDisable = true
|
mv.cvSearch.isDisable = true
|
||||||
|
|
||||||
@ -93,7 +67,6 @@ class MainViewController : Controller() {
|
|||||||
previewList = rootc.search(tags)
|
previewList = rootc.search(tags)
|
||||||
} ui {
|
} ui {
|
||||||
// when search finished
|
// when search finished
|
||||||
folderView.children.clear()
|
|
||||||
addAllElements(previewList)
|
addAllElements(previewList)
|
||||||
mv.spinnerSearch.isVisible = false
|
mv.spinnerSearch.isVisible = false
|
||||||
mv.cvSearch.isDisable = false
|
mv.cvSearch.isDisable = false
|
||||||
|
Loading…
Reference in New Issue
Block a user