From f5dbcc01341992dfb0a010d2060ed628d134dfc0 Mon Sep 17 00:00:00 2001 From: CodeSteak Date: Thu, 13 Jun 2019 18:27:44 +0200 Subject: [PATCH] use Borderpane + Anchorpane for #40 --- .../org/hso/texturesyncclient/app/Main.kt | 4 +-- .../view/mainView/MainView.kt | 35 ++++++++----------- 2 files changed, 16 insertions(+), 23 deletions(-) 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 967f3fd..863a0aa 100644 --- a/client/src/main/kotlin/org/hso/texturesyncclient/app/Main.kt +++ b/client/src/main/kotlin/org/hso/texturesyncclient/app/Main.kt @@ -19,9 +19,9 @@ class Main : App(StartupView::class) { // a different min-size. super.start(stage) - stage.minWidth = 1008.00 + stage.minWidth = 1050.00 stage.minHeight = 700.00 - stage.width = 1008.00 + stage.width = 1050.00 stage.height = 700.00 stage.isResizable = true stage.icons.add(Image("icons/TextureSync_Icon_256x256.png")) 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 a2ac6d3..054c1c8 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 @@ -20,28 +20,32 @@ class MainView : View("TextureSync") { private val mvc: MainViewController by inject() override val root = anchorpane { + background = Background(BackgroundFill(Paint.valueOf("#2b2b2b"), CornerRadii.EMPTY, Insets.EMPTY)) prefWidth = FX.primaryStage.width prefHeight = FX.primaryStage.height - add(cvSearch) + borderpane { + right = detailView.root + center = vbox { + add(cvSearch) + scrollpane { + style = "-fx-background-color:transparent;" + isFitToWidth = true + isFitToHeight = true - scrollpane { - style = "-fx-background-color:transparent;" - isFitToWidth = true - isFitToHeight = true - - add(folderView.root) + add(folderView.root) + } + } anchorpaneConstraints { - topAnchor = 106 + topAnchor = 0 bottomAnchor = 0 + rightAnchor = 0 leftAnchor = 0 - rightAnchor = 255 } } - add(detailView) add(btnImport) style { @@ -49,17 +53,6 @@ class MainView : View("TextureSync") { cvSearch.paddingAll = 5.0 cvSearch.minHeight = 65.0 cvSearch.style = "-fx-background-color: #53585b; -fx-text-inner-color: #b15b2e;" - cvSearch.anchorpaneConstraints { - topAnchor = 3 - leftAnchor = 3 - rightAnchor = 253 - } - - detailView.root.anchorpaneConstraints { - topAnchor = 0 - bottomAnchor = 0 - rightAnchor = 0 - } btnImport.buttonType = JFXButton.ButtonType.RAISED btnImport.styleClass.add("jfx-floating-action-button")