From f0fe4bb981899529a98d4ba049fdf2e67faceb26 Mon Sep 17 00:00:00 2001 From: CodeSteak Date: Fri, 14 Jun 2019 01:09:30 +0200 Subject: [PATCH] fix #46 --- .../controller/RootController.kt | 1 + .../view/importView/ImportView.kt | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/controller/RootController.kt b/client/src/main/kotlin/org/hso/texturesyncclient/controller/RootController.kt index dea6191..8465311 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/controller/RootController.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/controller/RootController.kt @@ -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() } } diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt b/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt index ddaee6f..a151af5 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt @@ -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()