mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-18 16:26:05 -04:00
Use FXUtils.bindString in FileSelector
This commit is contained in:
parent
dd56f4f8a6
commit
825df1981d
@ -29,6 +29,7 @@ import javafx.stage.DirectoryChooser;
|
|||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
import org.jackhuang.hmcl.setting.Theme;
|
import org.jackhuang.hmcl.setting.Theme;
|
||||||
import org.jackhuang.hmcl.ui.Controllers;
|
import org.jackhuang.hmcl.ui.Controllers;
|
||||||
|
import org.jackhuang.hmcl.ui.FXUtils;
|
||||||
import org.jackhuang.hmcl.ui.SVG;
|
import org.jackhuang.hmcl.ui.SVG;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -77,11 +78,11 @@ public class FileSelector extends HBox {
|
|||||||
|
|
||||||
public FileSelector() {
|
public FileSelector() {
|
||||||
JFXTextField customField = new JFXTextField();
|
JFXTextField customField = new JFXTextField();
|
||||||
customField.textProperty().bindBidirectional(valueProperty());
|
FXUtils.bindString(customField, valueProperty());
|
||||||
|
|
||||||
JFXButton selectButton = new JFXButton();
|
JFXButton selectButton = new JFXButton();
|
||||||
selectButton.setGraphic(SVG.folderOpen(Theme.blackFillBinding(), 15, 15));
|
selectButton.setGraphic(SVG.folderOpen(Theme.blackFillBinding(), 15, 15));
|
||||||
selectButton.setOnMouseClicked(e -> {
|
selectButton.setOnAction(e -> {
|
||||||
if (directory) {
|
if (directory) {
|
||||||
DirectoryChooser chooser = new DirectoryChooser();
|
DirectoryChooser chooser = new DirectoryChooser();
|
||||||
chooser.setTitle(chooserTitle);
|
chooser.setTitle(chooserTitle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user