fix(ui): validate background image url. Mentioned in #1116.
This commit is contained in:
@@ -226,6 +226,11 @@ public class MultiFileItem<T> extends VBox {
|
|||||||
|
|
||||||
BorderPane.setAlignment(customField, Pos.CENTER_RIGHT);
|
BorderPane.setAlignment(customField, Pos.CENTER_RIGHT);
|
||||||
customField.disableProperty().bind(left.selectedProperty().not());
|
customField.disableProperty().bind(left.selectedProperty().not());
|
||||||
|
|
||||||
|
if (!customField.getValidators().isEmpty()) {
|
||||||
|
FXUtils.setValidateWhileTextChanged(customField, true);
|
||||||
|
}
|
||||||
|
|
||||||
pane.setRight(customField);
|
pane.setRight(customField);
|
||||||
|
|
||||||
return pane;
|
return pane;
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public class PersonalizationPage extends StackPane {
|
|||||||
.setChooserTitle(i18n("launcher.background.choose"))
|
.setChooserTitle(i18n("launcher.background.choose"))
|
||||||
.bindBidirectional(config().backgroundImageProperty()),
|
.bindBidirectional(config().backgroundImageProperty()),
|
||||||
new MultiFileItem.StringOption<>(i18n("launcher.background.network"), EnumBackgroundImage.NETWORK)
|
new MultiFileItem.StringOption<>(i18n("launcher.background.network"), EnumBackgroundImage.NETWORK)
|
||||||
|
.setValidators(new URLValidator(true))
|
||||||
.bindBidirectional(config().backgroundImageUrlProperty())
|
.bindBidirectional(config().backgroundImageUrlProperty())
|
||||||
));
|
));
|
||||||
backgroundItem.selectedDataProperty().bindBidirectional(config().backgroundImageTypeProperty());
|
backgroundItem.selectedDataProperty().bindBidirectional(config().backgroundImageTypeProperty());
|
||||||
|
|||||||
Reference in New Issue
Block a user