Skip to content

Commit 63f93d7

Browse files
committed
update
1 parent 871bd87 commit 63f93d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcePackListPage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private ResourcePackListPageSkin(ResourcePackListPage control) {
287287
HBox.setHgrow(searchField, Priority.ALWAYS);
288288
PauseTransition pause = new PauseTransition(Duration.millis(100));
289289
pause.setOnFinished(e -> search());
290-
searchField.textProperty().addListener((observable, oldValue, newValue) -> {
290+
FXUtils.onChange(searchField.textProperty(), newValue -> {
291291
pause.setRate(1);
292292
pause.playFromStart();
293293
});
@@ -427,7 +427,7 @@ public static class ResourcePackInfoObject {
427427
public ResourcePackInfoObject(ResourcePackFile file) {
428428
this.file = file;
429429
this.enabled = new SimpleBooleanProperty(this, "enabled", file.isEnabled());
430-
this.enabled.addListener(__ -> file.setEnabled(enabled.get()));
430+
FXUtils.onChange(this.enabled, file::setEnabled);
431431
}
432432

433433
public ResourcePackFile getFile() {
@@ -600,7 +600,7 @@ private static final class ResourcePackInfoDialog extends JFXDialogLayout {
600600
descriptionPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
601601
descriptionPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
602602
descriptionPane.setFitToWidth(true);
603-
description.heightProperty().addListener((obs, oldVal, newVal) -> {
603+
FXUtils.onChange(description.heightProperty(), newVal -> {
604604
double maxHeight = stage.getHeight() * 0.5;
605605
double targetHeight = Math.min(newVal.doubleValue(), maxHeight);
606606
descriptionPane.setPrefViewportHeight(targetHeight);

0 commit comments

Comments
 (0)