TextureSync/client/src/main/kotlin/org/hso/texturesyncclient/view/importView/ImportView.kt

76 lines
2.0 KiB
Kotlin
Raw Normal View History

package org.hso.texturesyncclient.view.importView
import com.jfoenix.controls.JFXButton
import com.jfoenix.controls.JFXChipView
import com.jfoenix.controls.JFXTextField
import javafx.geometry.Pos
import javafx.scene.control.Label
import javafx.scene.layout.Priority
import javafx.scene.text.Font
import javafx.scene.text.FontWeight
import tornadofx.*
class ImportView : View() {
val labelHeading = Label("Textur hinzufügen")
val tfFilePath = JFXTextField()
val btnFileChooser = JFXButton("Datei öffnen")
val labelName = Label("Name")
val tfName = JFXTextField()
val labelTags = Label("Tags")
val cvTags = JFXChipView<String>()
private val ivc: ImportViewController by inject()
override val root = borderpane {
minWidth = 1000.0
minHeight = 500.0
center = vbox(50) {
maxWidth = 350.0
alignment = Pos.CENTER
add(labelHeading)
vbox(20) {
hbox(10) {
add(tfFilePath)
add(btnFileChooser)
}
vbox(5) {
add(labelName)
add(tfName)
}
vbox(5) {
add(labelTags)
add(cvTags)
}
}
}
style {
labelHeading.font = Font.font("Verdana", FontWeight.MEDIUM, 40.0)
tfFilePath.promptText = "Pfad ..."
tfFilePath.hgrow = Priority.ALWAYS
btnFileChooser.style = "-fx-button-type: RAISED; -fx-background-color: #FAAFFF; -fx-text-fill: BLACK;"
labelName.style = "-fx-font: 14px Verdana; -fx-text-fill: BLACK;"
tfName.promptText = "Name ..."
labelTags.style = "-fx-font: 14px Verdana; -fx-text-fill: BLACK;"
cvTags.style = "-fx-background-color: #FFFFFF;"
}
btnFileChooser.setOnAction {
ivc.btnFileChooserAction()
}
}
}