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
52 lines
1.3 KiB
package wow.doge.chatto.control
|
|
|
|
import javafx.scene.layout.VBox
|
|
import javafx.fxml.FXML
|
|
import javafx.scene.control.RadioButton
|
|
import javafx.scene.control.Label
|
|
import javafx.fxml.FXMLLoader
|
|
import scalafx.Includes._
|
|
|
|
class UserBox() extends VBox() {
|
|
@FXML private var _userRadioButton: RadioButton = _
|
|
@FXML private var _messageLabel: Label = _
|
|
|
|
def userRadioButton = this._userRadioButton
|
|
def messageLabel = this._messageLabel
|
|
|
|
init()
|
|
|
|
def init() = {
|
|
val fxmlLoader = new FXMLLoader(
|
|
getClass().getResource("/fxml/UserBox.fxml")
|
|
)
|
|
fxmlLoader.setRoot(this);
|
|
fxmlLoader.setController(this);
|
|
|
|
fxmlLoader.load();
|
|
|
|
// userRadioButton
|
|
// .selectedProperty()
|
|
// .addListener(changeListener => {
|
|
// if (userRadioButton.isSelected()) {
|
|
// getStyleClass().clear();
|
|
// getStyleClass().addAll("btn", "btn-primary", "user-box");
|
|
// } else {
|
|
// getStyleClass().clear();
|
|
// getStyleClass().addAll("btn", "btn-primary", "user-box");
|
|
// }
|
|
// });
|
|
|
|
userRadioButton.selected.onChange { (_, _, _) =>
|
|
{
|
|
getStyleClass().clear();
|
|
getStyleClass().addAll("btn", "btn-primary", "user-box");
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
object UserBox {
|
|
// val ub = new UserBox()
|
|
}
|