mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-19 13:46:04 +00:00
fixed broken bidi binding
This commit is contained in:
@@ -5,6 +5,7 @@ import org.cryptomator.ui.common.FxController;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javafx.beans.binding.Binding;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.scene.control.CheckBox;
|
||||
@@ -17,7 +18,7 @@ public class CheckListCellController implements FxController {
|
||||
private final Binding<Boolean> checkRunnable;
|
||||
|
||||
/* FXML */
|
||||
public CheckBox forRunSelectedCheckBox;
|
||||
public CheckBox checkbox;
|
||||
|
||||
@Inject
|
||||
public CheckListCellController() {
|
||||
@@ -27,9 +28,12 @@ public class CheckListCellController implements FxController {
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
forRunSelectedCheckBox.selectedProperty().addListener((observable, wasSelected, isSelected) -> {
|
||||
if (check.get() != null) {
|
||||
check.get().chosenForExecutionProperty().set(isSelected);
|
||||
check.addListener((observable, oldVal, newVal) -> {
|
||||
if (oldVal != null) {
|
||||
Bindings.unbindBidirectional(checkbox.selectedProperty(), oldVal.chosenForExecutionProperty());
|
||||
}
|
||||
if (newVal != null) {
|
||||
Bindings.bindBidirectional(checkbox.selectedProperty(), newVal.chosenForExecutionProperty());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</padding>
|
||||
|
||||
<StackPane minWidth="20" minHeight="20" alignment="CENTER">
|
||||
<CheckBox fx:id="forRunSelectedCheckBox" visible="${controller.checkRunnable}" />
|
||||
<CheckBox fx:id="checkbox" visible="${controller.checkRunnable}"/>
|
||||
<CheckStateIconView check="${controller.check}" glyphSize="20" visible="${!controller.checkRunnable}"/>
|
||||
</StackPane>
|
||||
<Label text="${controller.checkName}"/>
|
||||
|
||||
Reference in New Issue
Block a user