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.

52 lines
1.3 KiB

4 years ago
  1. package wow.doge.chatto.control
  2. import javafx.scene.layout.VBox
  3. import javafx.fxml.FXML
  4. import javafx.scene.control.RadioButton
  5. import javafx.scene.control.Label
  6. import javafx.fxml.FXMLLoader
  7. import scalafx.Includes._
  8. class UserBox() extends VBox() {
  9. @FXML private var _userRadioButton: RadioButton = _
  10. @FXML private var _messageLabel: Label = _
  11. def userRadioButton = this._userRadioButton
  12. def messageLabel = this._messageLabel
  13. init()
  14. def init() = {
  15. val fxmlLoader = new FXMLLoader(
  16. getClass().getResource("/fxml/UserBox.fxml")
  17. )
  18. fxmlLoader.setRoot(this);
  19. fxmlLoader.setController(this);
  20. fxmlLoader.load();
  21. // userRadioButton
  22. // .selectedProperty()
  23. // .addListener(changeListener => {
  24. // if (userRadioButton.isSelected()) {
  25. // getStyleClass().clear();
  26. // getStyleClass().addAll("btn", "btn-primary", "user-box");
  27. // } else {
  28. // getStyleClass().clear();
  29. // getStyleClass().addAll("btn", "btn-primary", "user-box");
  30. // }
  31. // });
  32. userRadioButton.selected.onChange { (_, _, _) =>
  33. {
  34. getStyleClass().clear();
  35. getStyleClass().addAll("btn", "btn-primary", "user-box");
  36. }
  37. }
  38. }
  39. }
  40. object UserBox {
  41. // val ub = new UserBox()
  42. }