Merge pull request #6708 from helixx87/refactor-radio

Refactor "remove radio" logic in JFXRadioButtonSkinBisqStyle
This commit is contained in:
Alejandro García 2023-05-23 09:06:15 +00:00 committed by GitHub
commit df6fe57423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,7 +174,7 @@ public class JFXRadioButtonSkinBisqStyle extends RadioButtonSkin {
protected void updateChildren() {
super.updateChildren();
if (radio != null) {
removeRadio();
getChildren().removeIf(child -> "radio".equals(child.getStyleClass().get(0)));
getChildren().addAll(container, rippler);
}
}
@ -216,15 +216,6 @@ public class JFXRadioButtonSkinBisqStyle extends RadioButtonSkin {
ripplerWidth, ripplerHeight);
}
private void removeRadio() {
// TODO: replace with removeIf
for (int i = 0; i < getChildren().size(); i++) {
if ("radio".equals(getChildren().get(i).getStyleClass().get(0))) {
getChildren().remove(i);
}
}
}
private void updateColors() {
boolean isSelected = getSkinnable().isSelected();
Color unSelectedColor = ((JFXRadioButton) getSkinnable()).getUnSelectedColor();