WIP desktop client for Chatto reimplemented in ScalaFX and Sapphire Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

46 lines
1.2 KiB

package wow.doge.chatto.controller
import com.typesafe.scalalogging.LazyLogging
import javafx.geometry.Insets
import javafx.scene.control.{Button, Label}
import javafx.scene.layout.HBox
import javax.enterprise.context.ApplicationScoped
import javax.inject.Named
@Named
@ApplicationScoped
class StatusBarController extends AbstractViewController with LazyLogging {
rootPane = new HBox()
val actionLabel: Label = new Label("Status Bar Action Label ...")
actionLabel.setPadding(new Insets(5))
val statusLabel: Label = new Label("Status Bar Status Label ...")
statusLabel.setPadding(new Insets(5))
val statusButton = new Button("Status Button 1")
statusButton.setOnAction(_ => {
logger.debug("%s".format(statusButton.getText))
updateLabel(statusButton)
})
val statusButton2 = new Button("Status Button 2")
statusButton2.setOnAction(_ => {
logger.debug("%s".format(statusButton2.getText))
updateLabel(statusButton2)
})
val box = new HBox()
box.setId("statusBar")
box.setPadding(new Insets(10))
box.setSpacing(10.0)
box.getChildren.addAll(statusButton, statusButton2, statusLabel, actionLabel)
rootPane = box
def updateLabel(button: Button): Unit = {
actionLabel.setText("%s clicked".format(button.getText))
}
}