This commit is contained in:
CodeSteak 2019-06-14 01:09:30 +02:00
parent 32883a2639
commit f0fe4bb981
2 changed files with 11 additions and 5 deletions

View File

@ -303,6 +303,7 @@ class RootController : Controller() {
fun switchMainToImport() {
Platform.runLater {
find(MainView::class).replaceWith(ImportView::class, sizeToScene = true, centerOnScreen = true)
find(ImportView::class).reset()
}
}

View File

@ -3,13 +3,13 @@ package org.hso.texturesyncclient.view.importView
import com.jfoenix.controls.JFXButton
import com.jfoenix.controls.JFXChipView
import com.jfoenix.controls.JFXTextField
import javafx.geometry.Insets
import javafx.geometry.Pos
import javafx.scene.layout.Background
import javafx.geometry.Insets
import javafx.scene.layout.BackgroundFill
import javafx.scene.layout.CornerRadii
import javafx.scene.paint.Paint
import javafx.scene.layout.Priority
import javafx.scene.paint.Paint
import org.hso.texturesyncclient.view.mainView.Preview3D
import tornadofx.*
@ -27,6 +27,10 @@ class ImportView : View("TextureSync") {
private val ivc: ImportViewController by inject()
init {
reset()
}
fun reset() {
btnImport.isVisible = false
preview.root.isVisible = false
}
@ -93,11 +97,12 @@ class ImportView : View("TextureSync") {
//TODO change color of Chip´s see: https://github.com/jfoenixadmin/JFoenix/blob/master/jfoenix/src/main/resources/com/jfoenix/assets/css/controls/jfx-chip-view.css#L52
btnImport.style = "-fx-button-type: RAISED; -fx-background-color: #b15b2e; -fx-text-fill: #3c3f41;"
btnBack.style = "-fx-button-type: RAISED; -fx-background-color: #3c3f41; -fx-text-fill: #2b7bbb; -fx-padding: 10;"
btnBack.style =
"-fx-button-type: RAISED; -fx-background-color: #3c3f41; -fx-text-fill: #2b7bbb; -fx-padding: 10;"
}
tfFilePath.textProperty().addListener{ _, _, _ -> ivc.validateImport() }
tfName.textProperty().addListener{ _, _, _ -> ivc.validateImport() }
tfFilePath.textProperty().addListener { _, _, _ -> ivc.validateImport() }
tfName.textProperty().addListener { _, _, _ -> ivc.validateImport() }
cvTags.chips.onChange {
ivc.validateImport()