diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/app/Main.kt b/client/src/main/kotlin/org/hso/texturesyncclient/app/Main.kt index 3aff1e1..eeb7a16 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/app/Main.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/app/Main.kt @@ -13,9 +13,11 @@ class Main: App(StartupView::class){ override fun start(stage: Stage) { - stage.minWidth = 1000.00 - stage.minHeight = 500.00 - stage.isResizable = false + stage.minWidth = 1008.00 + stage.minHeight = 535.00 + stage.width = 1008.00 + stage.height = 535.00 + stage.isResizable = true stage.icons.add(Image("icons/TextureSync_Icon_256x256.jpeg")) stage.setOnCloseRequest { System.exit(0) } diff --git a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/DetailView.kt b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/DetailView.kt index ecb58ad..f02d4dd 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/DetailView.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/view/mainView/DetailView.kt @@ -1,10 +1,8 @@ package org.hso.texturesyncclient.view.mainView -import com.jfoenix.controls.JFXButton import com.jfoenix.controls.JFXChipView import javafx.geometry.Insets import javafx.geometry.Orientation -import javafx.geometry.Pos import javafx.scene.control.Label import javafx.scene.image.Image import javafx.scene.layout.Background @@ -18,7 +16,6 @@ class DetailView: View() { val preview = Preview3D() val metaLabel = Label("Auflösung: 8MP\nName: Texture.png\nAndere: was anderes\nEinfügedatum: 31.02.2019") val cvTags = JFXChipView() - val btnImport = JFXButton("+") init { // set a default texture @@ -49,12 +46,6 @@ class DetailView: View() { } - field { - hbox(alignment = Pos.CENTER_RIGHT) { - add(btnImport) - } - } - } style { @@ -63,9 +54,6 @@ class DetailView: View() { cvTags.minHeight = 145.0 cvTags.paddingAll = 3.0 cvTags.style = "-fx-background-color: #53585b; -fx-text-inner-color: #b15b2e;" - - btnImport.buttonType = JFXButton.ButtonType.RAISED - btnImport.styleClass.add("jfx-floating-action-button") } } 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 27ec6d7..b2932cc 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 @@ -13,12 +13,7 @@ class FolderView : View("FolderView"){ hgap = 5.0 vgap = 5.0 paddingAll = 10.0 - prefWidth = 732.0 - prefHeight = 401.0 background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY)) - - style { - - } } + } \ No newline at end of file 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 1b0ca00..7784fe5 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 @@ -1,8 +1,8 @@ package org.hso.texturesyncclient.view.mainView +import com.jfoenix.controls.JFXButton import com.jfoenix.controls.JFXChipView import javafx.geometry.Insets -import javafx.scene.control.ScrollPane import javafx.scene.layout.Background import javafx.scene.layout.BackgroundFill @@ -13,51 +13,60 @@ import tornadofx.* class MainView : View("TextureSync") { val cvSearch = JFXChipView() + val btnImport = JFXButton("+") val folderView = find(FolderView::class) val detailView = find(DetailView::class) private val mvc: MainViewController by inject() - override val root = borderpane { + override val root = anchorpane { background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY)) - minWidth = 1000.0 - maxWidth = 1000.0 - minHeight = 500.0 - maxHeight = 500.0 + prefWidth = FX.primaryStage.width + prefHeight = FX.primaryStage.height - left = vbox { - //background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY)) - anchorpane{ - this.fitToParentWidth() - paddingAll = 5.0 - add(cvSearch) + add(cvSearch) + + scrollpane { + style = "-fx-background-color:transparent;" + isFitToWidth = true + isFitToHeight = true + + add(folderView.root) + + anchorpaneConstraints { + topAnchor = 106 + bottomAnchor = 0 + leftAnchor = 0 + rightAnchor = 255 } - anchorpane { - scrollpane { - this.fitToParentSize() - this.vbarPolicy = ScrollPane.ScrollBarPolicy.ALWAYS - add(folderView.root) - - style = "-fx-background-color:transparent;" - } - } - } - right = detailView.root + add(detailView) + add(btnImport) style { cvSearch.promptText = "Suche" cvSearch.paddingAll = 5.0 - cvSearch.minHeight = 70.0 + cvSearch.minHeight = 65.0 cvSearch.style = "-fx-background-color: #53585b; -fx-text-inner-color: #b15b2e;" cvSearch.anchorpaneConstraints { topAnchor = 3 - bottomAnchor = 3 leftAnchor = 3 - rightAnchor = -5 + rightAnchor = 253 } + detailView.root.anchorpaneConstraints { + topAnchor = 0 + bottomAnchor = 0 + rightAnchor = 0 + } + + btnImport.buttonType = JFXButton.ButtonType.RAISED + btnImport.styleClass.add("jfx-floating-action-button") + btnImport.anchorpaneConstraints { + bottomAnchor = 5 + rightAnchor = 5 + } } // actions @@ -65,12 +74,12 @@ class MainView : View("TextureSync") { mvc.cvSearchAction(cvSearch.chips) } - detailView.cvTags.chips.onChange { - mvc.updateTags() + btnImport.setOnAction { + mvc.btnImportAction() } - detailView.btnImport.setOnAction { - mvc.btnImportAction() + detailView.cvTags.chips.onChange { + mvc.updateTags() } }