diff --git a/src/main/java/cn/octopusyan/dmt/controller/MainController.java b/src/main/java/cn/octopusyan/dmt/controller/MainController.java index f9ff226..1ddeab4 100644 --- a/src/main/java/cn/octopusyan/dmt/controller/MainController.java +++ b/src/main/java/cn/octopusyan/dmt/controller/MainController.java @@ -215,8 +215,11 @@ public class MainController extends BaseController { ViewUtil.openDecorated("翻译设置", "setup/translate-view"); } - public void setFileName(String name) { - fileNameLabel.setText("PBO文件:" + name); + /** + * 关于 + */ + public void openAbout() { + ViewUtil.openDecorated("关于", "about-view"); } /** diff --git a/src/main/java/cn/octopusyan/dmt/controller/help/AboutController.java b/src/main/java/cn/octopusyan/dmt/controller/help/AboutController.java new file mode 100644 index 0000000..22fada3 --- /dev/null +++ b/src/main/java/cn/octopusyan/dmt/controller/help/AboutController.java @@ -0,0 +1,46 @@ +package cn.octopusyan.dmt.controller.help; + +import cn.octopusyan.dmt.common.base.BaseController; +import cn.octopusyan.dmt.common.config.Constants; +import cn.octopusyan.dmt.common.config.Context; +import cn.octopusyan.dmt.viewModel.AboutViewModel; +import javafx.scene.control.Label; +import javafx.scene.layout.Pane; +import javafx.scene.layout.VBox; + +/** + * 关于 + * + * @author octopus_yan + */ +public class AboutController extends BaseController { + public VBox root; + public Label title; + public Label infoTitle; + public Label version; + + @Override + public Pane getRootPanel() { + return root; + } + + @Override + public void initData() { + title.setText(Constants.APP_TITLE); + infoTitle.setText(Constants.APP_TITLE); + version.setText(STR."版本:\{Constants.APP_VERSION}(x64)"); + } + + @Override + public void initViewAction() { + + } + + public void openGitee() { + Context.openUrl("https://gitee.com/octopus_yan/dayz-mod-translator"); + } + + public void openGithub() { + Context.openUrl("https://github.com/octopusYan/dayz-mod-translator"); + } +} diff --git a/src/main/java/cn/octopusyan/dmt/viewModel/AboutViewModel.java b/src/main/java/cn/octopusyan/dmt/viewModel/AboutViewModel.java new file mode 100644 index 0000000..4298828 --- /dev/null +++ b/src/main/java/cn/octopusyan/dmt/viewModel/AboutViewModel.java @@ -0,0 +1,12 @@ +package cn.octopusyan.dmt.viewModel; + +import cn.octopusyan.dmt.common.base.BaseViewModel; +import cn.octopusyan.dmt.controller.help.AboutController; + +/** + * 关于 + * + * @author octopus_yan + */ +public class AboutViewModel extends BaseViewModel { +} diff --git a/src/main/resources/css/about-view.css b/src/main/resources/css/about-view.css new file mode 100644 index 0000000..bdb0c09 --- /dev/null +++ b/src/main/resources/css/about-view.css @@ -0,0 +1,14 @@ +#root #titleBox { + -fx-padding: 0 0 0 120; + -fx-background-color: -color-neutral-muted; +} + +#root #titleBox #title { + -fx-text-fill: -color-fg-default; + -fx-font-size: 25; +} + +#root #infoBox { + -fx-spacing: 25; + -fx-padding: 50 0 0 120; +} \ No newline at end of file diff --git a/src/main/resources/fxml/about-view.fxml b/src/main/resources/fxml/about-view.fxml new file mode 100644 index 0000000..979e951 --- /dev/null +++ b/src/main/resources/fxml/about-view.fxml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + diff --git a/src/main/resources/fxml/main-view.fxml b/src/main/resources/fxml/main-view.fxml index 895dfed..58c0108 100644 --- a/src/main/resources/fxml/main-view.fxml +++ b/src/main/resources/fxml/main-view.fxml @@ -34,10 +34,12 @@ - - - - + + + + + +