diff --git a/HMCL/image/hmcl.png b/HMCL/image/hmcl.png new file mode 100644 index 000000000..71b6d32f9 Binary files /dev/null and b/HMCL/image/hmcl.png differ diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java index d88550fb0..f613d8fb3 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java @@ -30,7 +30,6 @@ import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.Label; -import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; @@ -59,10 +58,7 @@ import org.jackhuang.hmcl.upgrade.hmcl.UpdateChecker; import org.jackhuang.hmcl.upgrade.hmcl.UpdateHandler; import org.jackhuang.hmcl.util.javafx.BindingMapping; import org.jackhuang.hmcl.util.javafx.MappedObservableList; -import org.jackhuang.hmcl.util.platform.JavaVersion; -import java.io.IOException; -import java.io.InputStream; import java.util.List; import java.util.Objects; import java.util.stream.IntStream; @@ -96,18 +92,7 @@ public final class MainPage extends StackPane implements DecoratorPage { titleNode.setPadding(new Insets(0, 0, 0, 2)); titleNode.setAlignment(Pos.CENTER_LEFT); - ImageView titleIcon = new ImageView(); - if (JavaVersion.CURRENT_JAVA.getParsedVersion() < 9) { - // JavaFX 8 has some problems with @2x images - // Force load the original icon - try (InputStream is = MainPage.class.getResourceAsStream("/assets/img/icon.png")) { - titleIcon.setImage(new Image(is, 20, 20, false, false)); - } catch (IOException ignored) { - } - } else { - titleIcon.setImage(FXUtils.newBuiltinImage("/assets/img/icon.png", 20, 20, false, false)); - } - + ImageView titleIcon = new ImageView(FXUtils.newBuiltinImage("/assets/img/icon-title.png")); Label titleLabel = new Label(Metadata.FULL_TITLE); titleLabel.getStyleClass().add("jfx-decorator-title"); titleNode.getChildren().setAll(titleIcon, titleLabel); diff --git a/HMCL/src/main/resources/assets/img/icon-title.png b/HMCL/src/main/resources/assets/img/icon-title.png new file mode 100644 index 000000000..938fda37c Binary files /dev/null and b/HMCL/src/main/resources/assets/img/icon-title.png differ diff --git a/HMCL/src/main/resources/assets/img/icon-title@2x.png b/HMCL/src/main/resources/assets/img/icon-title@2x.png new file mode 100644 index 000000000..b9162862d Binary files /dev/null and b/HMCL/src/main/resources/assets/img/icon-title@2x.png differ diff --git a/HMCL/src/main/resources/assets/img/icon.png b/HMCL/src/main/resources/assets/img/icon.png index 2fdf79cac..b9fc8fae9 100644 Binary files a/HMCL/src/main/resources/assets/img/icon.png and b/HMCL/src/main/resources/assets/img/icon.png differ diff --git a/HMCL/src/main/resources/assets/img/icon@2x.png b/HMCL/src/main/resources/assets/img/icon@2x.png index db03ca7cf..a7ae13a1b 100644 Binary files a/HMCL/src/main/resources/assets/img/icon@2x.png and b/HMCL/src/main/resources/assets/img/icon@2x.png differ diff --git a/HMCL/src/main/resources/assets/img/icon@8x.png b/HMCL/src/main/resources/assets/img/icon@8x.png index 921080e51..71b6d32f9 100644 Binary files a/HMCL/src/main/resources/assets/img/icon@8x.png and b/HMCL/src/main/resources/assets/img/icon@8x.png differ