mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fix password field styling
This commit is contained in:
parent
b997e7674d
commit
a056cf95a2
2 changed files with 3 additions and 2 deletions
|
@ -9,6 +9,7 @@ import io.xpipe.beacon.exchange.AskpassExchange;
|
|||
import io.xpipe.core.util.SecretValue;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.layout.StackPane;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -47,8 +48,7 @@ public class AskpassExchangeImpl extends AskpassExchange
|
|||
alert.setAlertType(Alert.AlertType.CONFIRMATION);
|
||||
|
||||
var text = new SecretFieldComp(prop).createRegion();
|
||||
text.setStyle("-fx-border-width: 1px");
|
||||
alert.getDialogPane().setContent(text);
|
||||
alert.getDialogPane().setContent(new StackPane(text));
|
||||
})
|
||||
.filter(b -> b.getButtonData().isDefaultButton() && prop.getValue() != null)
|
||||
.map(t -> {
|
||||
|
|
|
@ -25,6 +25,7 @@ public class SecretFieldComp extends Comp<CompStructure<TextField>> {
|
|||
@Override
|
||||
public CompStructure<TextField> createBase() {
|
||||
var text = new PasswordField();
|
||||
text.getStyleClass().add("secret-field-comp");
|
||||
text.setText(value.getValue() != null ? value.getValue().getSecretValue() : null);
|
||||
text.textProperty().addListener((c, o, n) -> {
|
||||
value.setValue(n != null && n.length() > 0 ? encrypt(n.toCharArray()) : null);
|
||||
|
|
Loading…
Reference in a new issue