mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 06:45:42 -04:00
Fix the layout of task executor pane
This commit is contained in:
parent
c7589e4e3c
commit
1516802a8d
@ -123,7 +123,7 @@ public final class Controllers {
|
||||
}
|
||||
|
||||
public static void dialog(String text, String title, int type, Runnable onAccept) {
|
||||
dialog(new MessageDialogPane(text, title, decorator.getDialog(), MessageBox.INFORMATION_MESSAGE, onAccept));
|
||||
dialog(new MessageDialogPane(text, title, decorator.getDialog(), type, onAccept));
|
||||
}
|
||||
|
||||
public static void confirmDialog(String text, String title, Runnable onAccept, Runnable onCacnel) {
|
||||
|
@ -68,7 +68,7 @@ public final class LeftPaneController {
|
||||
iconedItem.prefWidthProperty().bind(leftPane.widthProperty());
|
||||
iconedItem.setOnMouseClicked(e -> Controllers.navigate(Controllers.getSettingsPage()));
|
||||
}))
|
||||
.startCategory(Main.i18n("profile"))
|
||||
.startCategory(Main.i18n("profile").toUpperCase())
|
||||
.add(profilePane);
|
||||
|
||||
EventBus.EVENT_BUS.channel(ProfileLoadingEvent.class).register(this::onProfilesLoading);
|
||||
|
@ -64,7 +64,7 @@ public final class MessageDialogPane extends StackPane {
|
||||
Optional.ofNullable(onAccept).ifPresent(Runnable::run);
|
||||
});
|
||||
|
||||
actions.getChildren().remove(cancelButton);
|
||||
//actions.getChildren().remove(cancelButton);
|
||||
|
||||
switch (type) {
|
||||
case MessageBox.INFORMATION_MESSAGE:
|
||||
@ -79,11 +79,14 @@ public final class MessageDialogPane extends StackPane {
|
||||
case MessageBox.WARNING_MESSAGE:
|
||||
graphic.setGraphic(SVG.alert("black", 40, 40));
|
||||
break;
|
||||
case MessageBox.QUESTION_MESSAGE:
|
||||
graphic.setGraphic(SVG.help_circle("black", 40, 40));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public MessageDialogPane(String text, String title, JFXDialog dialog, Runnable onAccept, Runnable onCancel) {
|
||||
this(text, title, dialog, -1, onAccept);
|
||||
this(text, title, dialog, MessageBox.QUESTION_MESSAGE, onAccept);
|
||||
|
||||
cancelButton.setVisible(true);
|
||||
cancelButton.setOnMouseClicked(e -> {
|
||||
@ -95,9 +98,7 @@ public final class MessageDialogPane extends StackPane {
|
||||
acceptButton.setText(Main.i18n("button.yes"));
|
||||
cancelButton.setText(Main.i18n("button.no"));
|
||||
|
||||
actions.getChildren().add(cancelButton);
|
||||
|
||||
graphic.setGraphic(SVG.help_circle("black", 40, 40));
|
||||
//actions.getChildren().add(cancelButton);
|
||||
}
|
||||
|
||||
public void disableClosingDialog() {
|
||||
|
@ -7,16 +7,30 @@
|
||||
<?import com.jfoenix.controls.JFXButton?>
|
||||
|
||||
<?import org.jackhuang.hmcl.ui.construct.TaskListPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<fx:root xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
type="StackPane">
|
||||
<BorderPane>
|
||||
<top>
|
||||
<JFXProgressBar fx:id="progressBar" StackPane.alignment="TOP_CENTER" />
|
||||
</top>
|
||||
<center>
|
||||
<VBox alignment="TOP_CENTER" style="-fx-padding: 16px;">
|
||||
<Label fx:id="lblTitle" style="-fx-font-size: 20px;" />
|
||||
<Label fx:id="lblSubtitle" style="-fx-font-size: 14px;" />
|
||||
|
||||
<ScrollPane fitToHeight="true" fitToWidth="true" VBox.vgrow="ALWAYS">
|
||||
<TaskListPane fx:id="taskListPane" />
|
||||
</ScrollPane>
|
||||
</VBox>
|
||||
<StackPane pickOnBounds="false" style="-fx-padding: 8px;">
|
||||
<JFXButton StackPane.alignment="BOTTOM_RIGHT" fx:id="btnCancel" text="%button.cancel" />
|
||||
</StackPane>
|
||||
</center>
|
||||
<bottom>
|
||||
<HBox alignment="CENTER_RIGHT" style="-fx-padding: 8px;">
|
||||
<JFXButton fx:id="btnCancel" text="%button.cancel" />
|
||||
</HBox>
|
||||
</bottom>
|
||||
</BorderPane>
|
||||
</fx:root>
|
||||
|
@ -152,7 +152,7 @@ launch.failed.downloading_libraries=Did not finish downloading libraries, contin
|
||||
launch.failed.executable_permission=Unable to add permission to the launch script
|
||||
launch.failed.exited_abnormally=Game exited abnormally, please visit the log, or ask someone for help.
|
||||
launch.failed.prelaunch_command=Prelaunch command fail.
|
||||
launch.state.dependencies=Decompressing natives
|
||||
launch.state.dependencies=Dependencies
|
||||
launch.state.done=Done
|
||||
launch.state.logging_in=Logging In
|
||||
launch.state.modpack=Preparing for modpack
|
||||
|
@ -198,11 +198,11 @@ public class FileDownloadTask extends Task {
|
||||
if (!FileUtils.makeDirectory(file.getAbsoluteFile().getParentFile()))
|
||||
throw new IOException("Unable to make parent directory " + file);
|
||||
if (!temp.renameTo(file))
|
||||
throw new IOException("Unable move temp file to " + file);
|
||||
throw new IOException("Unable to move temp file from " + temp + " to " + file);
|
||||
}
|
||||
|
||||
if (downloaded != contentLength)
|
||||
throw new IllegalStateException("Unexptected file size: " + downloaded + ", expected: " + contentLength);
|
||||
throw new IllegalStateException("Unexpected file size: " + downloaded + ", expected: " + contentLength);
|
||||
|
||||
// Check hash code
|
||||
if (hash != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user