diff --git a/src/main/java/cn/octopusyan/dmt/controller/MainController.java b/src/main/java/cn/octopusyan/dmt/controller/MainController.java index 1ddeab4..b2240ab 100644 --- a/src/main/java/cn/octopusyan/dmt/controller/MainController.java +++ b/src/main/java/cn/octopusyan/dmt/controller/MainController.java @@ -146,54 +146,6 @@ public class MainController extends BaseController { ); } - /** - * 设置文件拖拽效果 - */ - private void setDragAction(Pane fileBox) { - - // 进入 - fileBox.setOnDragEntered(dragEvent -> { - var dragboard = dragEvent.getDragboard(); - if (dragboard.hasFiles() && isPboFile(dragboard.getFiles().getFirst())) { - selectFileBox.setVisible(true); - dragFileView.setVisible(true); - } - }); - - //离开 - fileBox.setOnDragExited(_ -> { - selectFileBox.setVisible(false); - dragFileView.setVisible(false); - }); - - // - fileBox.setOnDragOver(dragEvent -> { - var dragboard = dragEvent.getDragboard(); - if (dragEvent.getGestureSource() != fileBox && dragboard.hasFiles()) { - /* allow for both copying and moving, whatever user chooses */ - dragEvent.acceptTransferModes(TransferMode.COPY_OR_MOVE); - } - dragEvent.consume(); - }); - - // 松手 - fileBox.setOnDragDropped(dragEvent -> { - dragFileView.setVisible(false); - - var db = dragEvent.getDragboard(); - boolean success = false; - var file = db.getFiles().getFirst(); - if (db.hasFiles() && isPboFile(file)) { - selectFile(file); - success = true; - } - /* 让源知道字符串是否已成功传输和使用 */ - dragEvent.setDropCompleted(success); - - dragEvent.consume(); - }); - } - /** * 打开文件选择器 */ @@ -215,6 +167,13 @@ public class MainController extends BaseController { ViewUtil.openDecorated("翻译设置", "setup/translate-view"); } + /** + * 帮助 + */ + public void openHelp() { + Context.openUrl("https://www.52pojie.cn/thread-1891962-1-1.html"); + } + /** * 关于 */ @@ -222,6 +181,26 @@ public class MainController extends BaseController { ViewUtil.openDecorated("关于", "about-view"); } + public void startTranslate() { + viewModel.startTranslate(); + } + + public void startPack() { + viewModel.pack(); + } + + public void selectAllLog() { + logArea.selectAll(); + } + + public void copyLog() { + logArea.copy(); + } + + public void clearLog() { + logArea.clear(); + } + /** * 显示加载PBO文件 */ @@ -289,27 +268,55 @@ public class MainController extends BaseController { } } - public void startTranslate() { - viewModel.startTranslate(); - } + // ======================================{ private }======================================== - public void startPack() { - viewModel.pack(); - } + /** + * 设置文件拖拽效果 + */ + private void setDragAction(Pane fileBox) { - public void selectAllLog() { - logArea.selectAll(); - } + // 进入 + fileBox.setOnDragEntered(dragEvent -> { + var dragboard = dragEvent.getDragboard(); + if (dragboard.hasFiles() && isPboFile(dragboard.getFiles().getFirst())) { + selectFileBox.setVisible(true); + dragFileView.setVisible(true); + } + }); - public void copyLog() { - logArea.copy(); - } + //离开 + fileBox.setOnDragExited(_ -> { + selectFileBox.setVisible(false); + dragFileView.setVisible(false); + }); - public void clearLog() { - logArea.clear(); - } + // + fileBox.setOnDragOver(dragEvent -> { + var dragboard = dragEvent.getDragboard(); + if (dragEvent.getGestureSource() != fileBox && dragboard.hasFiles()) { + /* allow for both copying and moving, whatever user chooses */ + dragEvent.acceptTransferModes(TransferMode.COPY_OR_MOVE); + } + dragEvent.consume(); + }); - // ======================================{ }======================================== + // 松手 + fileBox.setOnDragDropped(dragEvent -> { + dragFileView.setVisible(false); + + var db = dragEvent.getDragboard(); + boolean success = false; + var file = db.getFiles().getFirst(); + if (db.hasFiles() && isPboFile(file)) { + selectFile(file); + success = true; + } + /* 让源知道字符串是否已成功传输和使用 */ + dragEvent.setDropCompleted(success); + + dragEvent.consume(); + }); + } /** * 打开文件 diff --git a/src/main/java/cn/octopusyan/dmt/controller/help/AboutController.java b/src/main/java/cn/octopusyan/dmt/controller/help/AboutController.java index 22fada3..c0b48d2 100644 --- a/src/main/java/cn/octopusyan/dmt/controller/help/AboutController.java +++ b/src/main/java/cn/octopusyan/dmt/controller/help/AboutController.java @@ -37,10 +37,14 @@ public class AboutController extends BaseController { } public void openGitee() { - Context.openUrl("https://gitee.com/octopus_yan/dayz-mod-translator"); + Context.openUrl("https://gitee.com/octopus_yan/dayz-mod-translator/releases"); } public void openGithub() { - Context.openUrl("https://github.com/octopusYan/dayz-mod-translator"); + Context.openUrl("https://github.com/octopusYan/dayz-mod-translator/releases"); + } + + public void openForum() { + Context.openUrl("https://www.52pojie.cn/thread-1891962-1-1.html"); } } diff --git a/src/main/resources/css/about-view.css b/src/main/resources/css/about-view.css index bdb0c09..3ce81b3 100644 --- a/src/main/resources/css/about-view.css +++ b/src/main/resources/css/about-view.css @@ -1,5 +1,5 @@ #root #titleBox { - -fx-padding: 0 0 0 120; + -fx-padding: 0 0 0 70; -fx-background-color: -color-neutral-muted; } @@ -9,6 +9,6 @@ } #root #infoBox { - -fx-spacing: 25; - -fx-padding: 50 0 0 120; + -fx-spacing: 20; + -fx-padding: 30 0 0 70; } \ No newline at end of file diff --git a/src/main/resources/fxml/about-view.fxml b/src/main/resources/fxml/about-view.fxml index 979e951..600ba5e 100644 --- a/src/main/resources/fxml/about-view.fxml +++ b/src/main/resources/fxml/about-view.fxml @@ -6,7 +6,7 @@ + fx:id="root" prefHeight="350.0" prefWidth="500.0"> diff --git a/src/main/resources/fxml/main-view.fxml b/src/main/resources/fxml/main-view.fxml index 58c0108..b29649b 100644 --- a/src/main/resources/fxml/main-view.fxml +++ b/src/main/resources/fxml/main-view.fxml @@ -35,6 +35,11 @@ + + + + +