2019-04-30 16:49:02 +02:00
package org.hso.texturesyncclient.view.mainView
2019-06-04 18:20:09 +02:00
import com.jfoenix.controls.JFXChipView
import com.jfoenix.controls.JFXSpinner
import javafx.geometry.Insets
2019-06-05 15:44:12 +02:00
import javafx.scene.control.ScrollPane
2019-06-04 20:49:07 +02:00
2019-06-04 18:20:09 +02:00
import javafx.scene.layout.Background
import javafx.scene.layout.BackgroundFill
import javafx.scene.layout.CornerRadii
import javafx.scene.paint.Paint
2019-04-30 16:49:02 +02:00
import tornadofx.*
class MainView : View ( ) {
2019-06-04 18:20:09 +02:00
val cvSearch = JFXChipView < String > ( )
2019-05-09 15:24:45 +02:00
val folderView = find ( FolderView :: class )
val detailView = find ( DetailView :: class )
2019-04-30 16:49:02 +02:00
2019-05-08 18:12:31 +02:00
private val mvc : MainViewController by inject ( )
override val root = borderpane {
minWidth = 1000.0
2019-06-04 18:20:09 +02:00
maxWidth = 1000.0
2019-05-08 18:12:31 +02:00
minHeight = 500.0
2019-06-04 18:20:09 +02:00
maxHeight = 500.0
left = vbox {
2019-06-05 15:44:12 +02:00
background = Background ( BackgroundFill ( Paint . valueOf ( " #2b2b2b " ) , CornerRadii . EMPTY , Insets . EMPTY ) )
2019-06-04 18:20:09 +02:00
add ( cvSearch )
2019-06-05 15:44:12 +02:00
anchorpane {
scrollpane {
this . fitToParentSize ( )
this . vbarPolicy = ScrollPane . ScrollBarPolicy . ALWAYS
add ( folderView . root )
}
2019-06-04 18:20:09 +02:00
}
2019-06-05 15:44:12 +02:00
2019-06-04 18:20:09 +02:00
}
2019-05-08 18:12:31 +02:00
right = detailView . root
style {
2019-06-04 18:20:09 +02:00
cvSearch . paddingAll = 7.0
2019-06-04 20:49:07 +02:00
cvSearch . minHeight = 70.0
cvSearch . style = " -fx-background-color: #3c3f41; -fx-text-inner-color: #b15b2e; "
2019-05-08 18:12:31 +02:00
}
// actions
2019-06-04 20:49:07 +02:00
cvSearch . chips . onChange {
mvc . cvSearchAction ( cvSearch . chips )
2019-06-04 18:20:09 +02:00
}
2019-05-09 15:24:45 +02:00
2019-06-04 20:49:07 +02:00
detailView . cvTags . chips . onChange {
2019-05-09 15:24:45 +02:00
mvc . updateTags ( )
}
2019-06-05 16:23:45 +02:00
detailView . btnImport . setOnAction {
mvc . btnImportAction ( )
}
2019-05-08 18:12:31 +02:00
}
2019-04-30 16:49:02 +02:00
}