diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Theme.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Theme.java index 9a81e2301..c3d172903 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Theme.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Theme.java @@ -192,8 +192,6 @@ public class Theme { return c != null ? String.format("#%02x%02x%02x", Math.round(c.getRed() * 255.0D), Math.round(c.getGreen() * 255.0D), Math.round(c.getBlue() * 255.0D)).toUpperCase(Locale.ROOT) : null; } - private static final ObjectBinding BLACK_FILL = Bindings.createObjectBinding(() -> BLACK); - private static final ObjectBinding WHITE_FILL = Bindings.createObjectBinding(() -> Color.WHITE); private static ObjectBinding FOREGROUND_FILL; public static ObjectBinding foregroundFillBinding() { @@ -206,12 +204,12 @@ public class Theme { return FOREGROUND_FILL; } - public static ObjectBinding blackFillBinding() { - return BLACK_FILL; + public static Color blackFill() { + return BLACK; } - public static ObjectBinding whiteFillBinding() { - return WHITE_FILL; + public static Color whiteFill() { + return Color.WHITE; } public static class TypeAdapter extends com.google.gson.TypeAdapter { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java index 67a7c7012..d7e03a00a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java @@ -766,13 +766,6 @@ public final class FXUtils { } }; - public static Runnable withJFXPopupClosing(Runnable runnable, JFXPopup popup) { - return () -> { - runnable.run(); - popup.hide(); - }; - } - public static void onEscPressed(Node node, Runnable action) { node.addEventHandler(KeyEvent.KEY_PRESSED, e -> { if (e.getCode() == KeyCode.ESCAPE) { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java index 994a64212..a8ff44826 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java @@ -252,7 +252,7 @@ public class InstallerItem extends Control { pane.getChildren().add(buttonsContainer); JFXButton closeButton = new JFXButton(); - closeButton.setGraphic(SVG.close(Theme.blackFillBinding(), -1, -1)); + closeButton.setGraphic(SVG.CLOSE.createIcon(Theme.blackFill(), -1, -1)); closeButton.getStyleClass().add("toggle-icon4"); closeButton.visibleProperty().bind(control.removable); closeButton.managedProperty().bind(closeButton.visibleProperty()); @@ -261,8 +261,8 @@ public class InstallerItem extends Control { JFXButton arrowButton = new JFXButton(); arrowButton.graphicProperty().bind(Bindings.createObjectBinding(() -> control.upgradable.get() - ? SVG.update(Theme.blackFillBinding(), -1, -1) - : SVG.arrowRight(Theme.blackFillBinding(), -1, -1), + ? SVG.UPDATE.createIcon(Theme.blackFill(), -1, -1) + : SVG.ARROW_RIGHT.createIcon(Theme.blackFill(), -1, -1), control.upgradable)); arrowButton.getStyleClass().add("toggle-icon4"); arrowButton.visibleProperty().bind(Bindings.createBooleanBinding( diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java index f53065f0f..ffbe90d46 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java @@ -69,7 +69,7 @@ public class ListPageSkin extends SkinBase> { FXUtils.setLimitHeight(btnAdd, 40); btnAdd.getStyleClass().add("jfx-button-raised-round"); btnAdd.setButtonType(JFXButton.ButtonType.RAISED); - btnAdd.setGraphic(SVG.plus(Theme.whiteFillBinding(), -1, -1)); + btnAdd.setGraphic(SVG.PLUS.createIcon(Theme.whiteFill(), -1, -1)); btnAdd.setOnMouseClicked(e -> skinnable.add()); JFXButton btnRefresh = new JFXButton(); @@ -77,7 +77,7 @@ public class ListPageSkin extends SkinBase> { FXUtils.setLimitHeight(btnRefresh, 40); btnRefresh.getStyleClass().add("jfx-button-raised-round"); btnRefresh.setButtonType(JFXButton.ButtonType.RAISED); - btnRefresh.setGraphic(SVG.refresh(Theme.whiteFillBinding(), -1, -1)); + btnRefresh.setGraphic(SVG.REFRESH.createIcon(Theme.whiteFill(), -1, -1)); btnRefresh.setOnMouseClicked(e -> skinnable.refresh()); vBox.getChildren().setAll(btnAdd); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java index 283d9e6e9..e79ca4c02 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SVG.java @@ -17,7 +17,7 @@ */ package org.jackhuang.hmcl.ui; -import javafx.beans.binding.ObjectBinding; +import javafx.beans.value.ObservableValue; import javafx.geometry.Pos; import javafx.scene.Group; import javafx.scene.Node; @@ -25,21 +25,103 @@ import javafx.scene.layout.StackPane; import javafx.scene.paint.Paint; import javafx.scene.shape.SVGPath; -public final class SVG { - private SVG() { +public enum SVG { + GEAR("M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"), + GEAR_OUTLINE("M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z"), + BACK("M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"), + CANCEL("M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z"), + CLOSE("M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"), + COPY("M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"), + DOTS_VERTICAL("M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"), + DOTS_HORIZONTAL("M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"), + DELETE("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"), + DELETE_OUTLINE("M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z"), + ACCOUNT_EDIT("M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z"), + EXPAND("M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"), + COLLAPSE("M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"), + NAVIGATE("M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"), + ROCKET_LAUNCH_OUTLINE("M13.13 22.19L11.5 18.36C13.07 17.78 14.54 17 15.9 16.09L13.13 22.19M5.64 12.5L1.81 10.87L7.91 8.1C7 9.46 6.22 10.93 5.64 12.5M19.22 4C19.5 4 19.75 4 19.96 4.05C20.13 5.44 19.94 8.3 16.66 11.58C14.96 13.29 12.93 14.6 10.65 15.47L8.5 13.37C9.42 11.06 10.73 9.03 12.42 7.34C15.18 4.58 17.64 4 19.22 4M19.22 2C17.24 2 14.24 2.69 11 5.93C8.81 8.12 7.5 10.53 6.65 12.64C6.37 13.39 6.56 14.21 7.11 14.77L9.24 16.89C9.62 17.27 10.13 17.5 10.66 17.5C10.89 17.5 11.13 17.44 11.36 17.35C13.5 16.53 15.88 15.19 18.07 13C23.73 7.34 21.61 2.39 21.61 2.39S20.7 2 19.22 2M14.54 9.46C13.76 8.68 13.76 7.41 14.54 6.63S16.59 5.85 17.37 6.63C18.14 7.41 18.15 8.68 17.37 9.46C16.59 10.24 15.32 10.24 14.54 9.46M8.88 16.53L7.47 15.12L8.88 16.53M6.24 22L9.88 18.36C9.54 18.27 9.21 18.12 8.91 17.91L4.83 22H6.24M2 22H3.41L8.18 17.24L6.76 15.83L2 20.59V22M2 19.17L6.09 15.09C5.88 14.79 5.73 14.47 5.64 14.12L2 17.76V19.17Z"), + LAUNCH_OUTLINE("M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"), + SCRIPT("M14,20A2,2 0 0,0 16,18V5H9A1,1 0 0,0 8,6V16H5V5A3,3 0 0,1 8,2H19A3,3 0 0,1 22,5V6H18V18L18,19A3,3 0 0,1 15,22H5A3,3 0 0,1 2,19V18H12A2,2 0 0,0 14,20Z"), + PENCIL("M20.71,4.04C21.1,3.65 21.1,3 20.71,2.63L18.37,0.29C18,-0.1 17.35,-0.1 16.96,0.29L15,2.25L18.75,6M17.75,7L14,3.25L4,13.25V17H7.75L17.75,7Z"), + PENCIL_OUTLINE("M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"), + REFRESH("M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"), + FOLDER_OPEN("M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z"), + FOLDER_OUTLINE("M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z"), + UPDATE("M21,10.12H14.22L16.96,7.3C14.23,4.6 9.81,4.5 7.08,7.2C4.35,9.91 4.35,14.28 7.08,17C9.81,19.7 14.23,19.7 16.96,17C18.32,15.65 19,14.08 19,12.1H21C21,14.08 20.12,16.65 18.36,18.39C14.85,21.87 9.15,21.87 5.64,18.39C2.14,14.92 2.11,9.28 5.62,5.81C9.13,2.34 14.76,2.34 18.27,5.81L21,3V10.12M12.5,8V12.25L16,14.33L15.28,15.54L11,13V8H12.5Z"), + CLOSE_CIRCLE("M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"), + CHECK_CIRCLE("M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z"), + INFO_CIRCLE("M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"), + HELP_CIRCLE("M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"), + HELP_CIRCLE_OUTLINE("M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z"), + ALERT("M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"), + ALERT_OUTLINE("M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16"), + PLUS("M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"), + PLUS_CIRCLE_OUTLINE("M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z"), + IMPORT_ICON("M14,12L10,8V11H2V13H10V16M20,18V6C20,4.89 19.1,4 18,4H6A2,2 0 0,0 4,6V9H6V6H18V18H6V15H4V18A2,2 0 0,0 6,20H18A2,2 0 0,0 20,18Z"), + EXPORT("M23,12L19,8V11H10V13H19V16M1,18V6C1,4.89 1.9,4 3,4H15A2,2 0 0,1 17,6V9H15V6H3V18H15V15H17V18A2,2 0 0,1 15,20H3A2,2 0 0,1 1,18Z"), + OPEN_IN_NEW("M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"), + TRIANGLE("M1,21H23L12,2"), + HOME("M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"), + VIEW_LIST("M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"), + CHECK("M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"), + ARROW_RIGHT("M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"), + WRENCH("M22.7,19L13.6,9.9C14.5,7.6 14,4.9 12.1,3C10.1,1 7.1,0.6 4.7,1.7L9,6L6,9L1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1C4.8,14 7.5,14.5 9.8,13.6L18.9,22.7C19.3,23.1 19.9,23.1 20.3,22.7L22.6,20.4C23.1,20 23.1,19.3 22.7,19Z"), + WRENCH_OUTLINE("M22.61,19L13.53,9.91C14.46,7.57 14,4.81 12.09,2.91C9.79,0.61 6.21,0.4 3.66,2.26L7.5,6.11L6.08,7.5L2.25,3.69C0.39,6.23 0.6,9.82 2.9,12.11C4.76,13.97 7.47,14.46 9.79,13.59L18.9,22.7C19.29,23.09 19.92,23.09 20.31,22.7L22.61,20.4C23,20 23,19.39 22.61,19M19.61,20.59L10.15,11.13C9.54,11.58 8.86,11.85 8.15,11.95C6.79,12.15 5.36,11.74 4.32,10.7C3.37,9.76 2.93,8.5 3,7.26L6.09,10.35L10.33,6.11L7.24,3C8.5,2.95 9.73,3.39 10.68,4.33C11.76,5.41 12.17,6.9 11.92,8.29C11.8,9 11.5,9.66 11.04,10.25L20.5,19.7L19.61,20.59Z"), + UPLOAD("M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z"), + HANGER("M12 4A3.5 3.5 0 0 0 8.5 7.5H10.5A1.5 1.5 0 0 1 12 6A1.5 1.5 0 0 1 13.5 7.5A1.5 1.5 0 0 1 12 9C11.45 9 11 9.45 11 10V11.75L2.4 18.2A1 1 0 0 0 3 20H21A1 1 0 0 0 21.6 18.2L13 11.75V10.85A3.5 3.5 0 0 0 15.5 7.5A3.5 3.5 0 0 0 12 4M12 13.5L18 18H6Z"), + PUZZLE("M22,13.5C22,15.26 20.7,16.72 19,16.96V20A2,2 0 0,1 17,22H13.2V21.7A2.7,2.7 0 0,0 10.5,19C9,19 7.8,20.21 7.8,21.7V22H4A2,2 0 0,1 2,20V16.2H2.3C3.79,16.2 5,15 5,13.5C5,12 3.79,10.8 2.3,10.8H2V7A2,2 0 0,1 4,5H7.04C7.28,3.3 8.74,2 10.5,2C12.26,2 13.72,3.3 13.96,5H17A2,2 0 0,1 19,7V10.04C20.7,10.28 22,11.74 22,13.5M17,15H18.5A1.5,1.5 0 0,0 20,13.5A1.5,1.5 0 0,0 18.5,12H17V7H12V5.5A1.5,1.5 0 0,0 10.5,4A1.5,1.5 0 0,0 9,5.5V7H4V9.12C5.76,9.8 7,11.5 7,13.5C7,15.5 5.75,17.2 4,17.88V20H6.12C6.8,18.25 8.5,17 10.5,17C12.5,17 14.2,18.25 14.88,20H17V15Z"), + CUBE("M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L6.04,7.5L12,10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z"), + PACK("M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L10.11,5.22L16,8.61L17.96,7.5L12,4.15M6.04,7.5L12,10.85L13.96,9.75L8.08,6.35L6.04,7.5M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z"), + TEXTURE_BOX("M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z"), + GAMEPAD("M6,9H8V11H10V13H8V15H6V13H4V11H6V9M18.5,9A1.5,1.5 0 0,1 20,10.5A1.5,1.5 0 0,1 18.5,12A1.5,1.5 0 0,1 17,10.5A1.5,1.5 0 0,1 18.5,9M15.5,12A1.5,1.5 0 0,1 17,13.5A1.5,1.5 0 0,1 15.5,15A1.5,1.5 0 0,1 14,13.5A1.5,1.5 0 0,1 15.5,12M17,5A7,7 0 0,1 24,12A7,7 0 0,1 17,19C15.04,19 13.27,18.2 12,16.9C10.73,18.2 8.96,19 7,19A7,7 0 0,1 0,12A7,7 0 0,1 7,5H17M7,7A5,5 0 0,0 2,12A5,5 0 0,0 7,17C8.64,17 10.09,16.21 11,15H13C13.91,16.21 15.36,17 17,17A5,5 0 0,0 22,12A5,5 0 0,0 17,7H7Z"), + FIRE("M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z"), + MONITOR_SCREENSHOT("M9,6H5V10H7V8H9M19,10H17V12H15V14H19M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2"), + TEXTURE("M9.29,21H12.12L21,12.12V9.29M19,21C19.55,21 20.05,20.78 20.41,20.41C20.78,20.05 21,19.55 21,19V17L17,21M5,3A2,2 0 0,0 3,5V7L7,3M11.88,3L3,11.88V14.71L14.71,3M19.5,3.08L3.08,19.5C3.17,19.85 3.35,20.16 3.59,20.41C3.84,20.65 4.15,20.83 4.5,20.92L20.93,4.5C20.74,3.8 20.2,3.26 19.5,3.08Z"), + ALPHA_CIRCLE_OUTLINE("M11,7H13A2,2 0 0,1 15,9V17H13V13H11V17H9V9A2,2 0 0,1 11,7M11,9V11H13V9H11M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2Z"), + BETA_CIRCLE_OUTLINE("M15,10.5C15,11.3 14.3,12 13.5,12C14.3,12 15,12.7 15,13.5V15A2,2 0 0,1 13,17H9V7H13A2,2 0 0,1 15,9V10.5M13,15V13H11V15H13M13,11V9H11V11H13M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z"), + RELEASE_CIRCLE_OUTLINE("M9,7H13A2,2 0 0,1 15,9V11C15,11.84 14.5,12.55 13.76,12.85L15,17H13L11.8,13H11V17H9V7M11,9V11H13V9H11M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,16.41 7.58,20 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z"), + INFORMATION_OUTLINE("M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"), + HAND_HEAR_OUTLINE("M16 3.23C16.71 2.41 17.61 2 18.7 2C19.61 2 20.37 2.33 21 3C21.63 3.67 21.96 4.43 22 5.3C22 6 21.67 6.81 21 7.76S19.68 9.5 19.03 10.15C18.38 10.79 17.37 11.74 16 13C14.61 11.74 13.59 10.79 12.94 10.15S11.63 8.71 10.97 7.76C10.31 6.81 10 6 10 5.3C10 4.39 10.32 3.63 10.97 3C11.62 2.37 12.4 2.04 13.31 2C14.38 2 15.27 2.41 16 3.23M22 19V20L14 22.5L7 20.56V22H1V11H8.97L15.13 13.3C16.25 13.72 17 14.8 17 16H19C20.66 16 22 17.34 22 19M5 20V13H3V20H5M19.9 18.57C19.74 18.24 19.39 18 19 18H13.65C13.11 18 12.58 17.92 12.07 17.75L9.69 16.96L10.32 15.06L12.7 15.85C13 15.95 15 16 15 16C15 15.63 14.77 15.3 14.43 15.17L8.61 13H7V18.5L13.97 20.41L19.9 18.57Z"), + MOJANG("m 13.965847,0 c -1.010612,0.82802228 -1.197232,2.1950303 -1.265172,3.4179557 0.02123,1.0021189 1.341654,1.2994159 1.953117,0.590289 C 15.091158,2.6579315 14.369242,1.2738804 13.965847,0 Z M 10.913012,2.9296764 C 10.755901,3.6982508 10.628413,4.4668999 10.492533,5.2354744 8.9893533,3.9913178 7.1504705,3.0824837 5.1419856,3.2947971 3.4944341,3.4646478 0.94293227,2.6961479 0.14038761,4.645185 -0.12288102,8.3139606 0.07223999,12.01236 0.03402357,15.689629 c -0.12314178,1.222925 0.86170213,2.420422 2.14407513,2.280295 4.2207899,0.03397 8.4502143,0.04723 12.6710043,-0.0038 1.265389,0.135918 1.957646,-1.010748 2.13599,-2.0893 C 13.269608,16.437357 9.1760813,16.929609 5.7111265,15.129192 2.5986124,13.58355 2.246023,8.3138817 5.5581114,6.7979639 9.3203049,5.1758896 13.859607,8.0382886 14.942405,11.787743 15.613316,12.11046 16.284433,12.424684 16.95959,12.743154 16.624135,10.348258 16.653651,7.800456 15.579346,5.5881508 15.057054,4.7473897 14.097531,6.2714182 13.379911,5.6217388 12.416008,4.865903 11.749527,3.8128948 10.913012,2.9296713 Z"), + MICROSOFT("M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z"), + ACCOUNT_OUTLINE("M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M12,13C14.67,13 20,14.33 20,17V20H4V17C4,14.33 9.33,13 12,13M12,14.9C9.03,14.9 5.9,16.36 5.9,17V18.1H18.1V17C18.1,16.36 14.97,14.9 12,14.9Z"), + ACCOUNT_GROUP_OUTLINE("M12,5A3.5,3.5 0 0,0 8.5,8.5A3.5,3.5 0 0,0 12,12A3.5,3.5 0 0,0 15.5,8.5A3.5,3.5 0 0,0 12,5M12,7A1.5,1.5 0 0,1 13.5,8.5A1.5,1.5 0 0,1 12,10A1.5,1.5 0 0,1 10.5,8.5A1.5,1.5 0 0,1 12,7M5.5,8A2.5,2.5 0 0,0 3,10.5C3,11.44 3.53,12.25 4.29,12.68C4.65,12.88 5.06,13 5.5,13C5.94,13 6.35,12.88 6.71,12.68C7.08,12.47 7.39,12.17 7.62,11.81C6.89,10.86 6.5,9.7 6.5,8.5C6.5,8.41 6.5,8.31 6.5,8.22C6.2,8.08 5.86,8 5.5,8M18.5,8C18.14,8 17.8,8.08 17.5,8.22C17.5,8.31 17.5,8.41 17.5,8.5C17.5,9.7 17.11,10.86 16.38,11.81C16.5,12 16.63,12.15 16.78,12.3C16.94,12.45 17.1,12.58 17.29,12.68C17.65,12.88 18.06,13 18.5,13C18.94,13 19.35,12.88 19.71,12.68C20.47,12.25 21,11.44 21,10.5A2.5,2.5 0 0,0 18.5,8M12,14C9.66,14 5,15.17 5,17.5V19H19V17.5C19,15.17 14.34,14 12,14M4.71,14.55C2.78,14.78 0,15.76 0,17.5V19H3V17.07C3,16.06 3.69,15.22 4.71,14.55M19.29,14.55C20.31,15.22 21,16.06 21,17.07V19H24V17.5C24,15.76 21.22,14.78 19.29,14.55M12,16C13.53,16 15.24,16.5 16.23,17H7.77C8.76,16.5 10.47,16 12,16Z"), + ACCOUNT_ARROW_RIGHT_OUTLINE("M19,21V19H15V17H19V15L22,18L19,21M13,18C13,18.71 13.15,19.39 13.42,20H2V17C2,14.79 5.58,13 10,13C11,13 11.96,13.09 12.85,13.26C13.68,13.42 14.44,13.64 15.11,13.92C13.83,14.83 13,16.32 13,18M4,17V18H11C11,16.96 11.23,15.97 11.64,15.08L10,15C6.69,15 4,15.9 4,17M10,4A4,4 0 0,1 14,8A4,4 0 0,1 10,12A4,4 0 0,1 6,8A4,4 0 0,1 10,4M10,6A2,2 0 0,0 8,8A2,2 0 0,0 10,10A2,2 0 0,0 12,8A2,2 0 0,0 10,6Z"), + STYLE_OUTLINE("M2.5 19.6L3.8 20.2V11.2L1.4 17C1 18.1 1.5 19.2 2.5 19.6M15.2 4.8L20.2 16.8L12.9 19.8L7.9 7.9V7.8L15.2 4.8M15.3 2.8C15 2.8 14.8 2.8 14.5 2.9L7.1 6C6.4 6.3 5.9 7 5.9 7.8C5.9 8 5.9 8.3 6 8.6L11 20.5C11.3 21.3 12 21.7 12.8 21.7C13.1 21.7 13.3 21.7 13.6 21.6L21 18.5C22 18.1 22.5 16.9 22.1 15.9L17.1 4C16.8 3.2 16 2.8 15.3 2.8M10.5 9.9C9.9 9.9 9.5 9.5 9.5 8.9S9.9 7.9 10.5 7.9C11.1 7.9 11.5 8.4 11.5 8.9S11.1 9.9 10.5 9.9M5.9 19.8C5.9 20.9 6.8 21.8 7.9 21.8H9.3L5.9 13.5V19.8Z"), + DOWNLOAD_OUTLINE("M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z"), + APPLICATION_OUTLINE("M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 20H3V6H21V20Z"), + EARTH("M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"), + BELL("M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21"), + CONTENT_SAVE_MOVE_OUTLINE("M13 17H17V14L22 18.5L17 23V20H13V17M14 12.8C13.5 12.31 12.78 12 12 12C10.34 12 9 13.34 9 15C9 16.31 9.84 17.41 11 17.82C11.07 15.67 12.27 13.8 14 12.8M11.09 19H5V5H16.17L19 7.83V12.35C19.75 12.61 20.42 13 21 13.54V7L17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H11.81C11.46 20.39 11.21 19.72 11.09 19M6 10H15V6H6V10Z"), + ACCOUNT("M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"), + SERVER("M13,19H14A1,1 0 0,1 15,20H22V22H15A1,1 0 0,1 14,23H10A1,1 0 0,1 9,22H2V20H9A1,1 0 0,1 10,19H11V17H4A1,1 0 0,1 3,16V12A1,1 0 0,1 4,11H20A1,1 0 0,1 21,12V16A1,1 0 0,1 20,17H13V19M4,3H20A1,1 0 0,1 21,4V8A1,1 0 0,1 20,9H4A1,1 0 0,1 3,8V4A1,1 0 0,1 4,3M9,7H10V5H9V7M9,15H10V13H9V15M5,5V7H7V5H5M5,13V15H7V13H5Z"), + MESSAGE_ALERT_OUTLINE("M13,10H11V6H13V10M13,12H11V14H13V12M22,4V16A2,2 0 0,1 20,18H6L2,22V4A2,2 0 0,1 4,2H20A2,2 0 0,1 22,4M20,4H4V17.2L5.2,16H20V4Z"), + CHECK_CIRCLE_OUTLINE("M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"), + CLOSE_CIRCLE_OUTLINE("M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z"), + CLOCK_OUTLINE("M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z"), + MAGNIFY("M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"), + MENU_UP("M7,15L12,10L17,15H7Z"), + MENU_DOWN("M7,10L12,15L17,10H7Z"), + RESTORE("M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z"), + BUG("M14,12H10V10H14M14,16H10V14H14M20,8H17.19C16.74,7.22 16.12,6.55 15.37,6.04L17,4.41L15.59,3L13.42,5.17C12.96,5.06 12.5,5 12,5C11.5,5 11.04,5.06 10.59,5.17L8.41,3L7,4.41L8.62,6.04C7.88,6.55 7.26,7.22 6.81,8H4V10H6.09C6.04,10.33 6,10.66 6,11V12H4V14H6V15C6,15.34 6.04,15.67 6.09,16H4V18H6.81C7.85,19.79 9.78,21 12,21C14.22,21 16.15,19.79 17.19,18H20V16H17.91C17.96,15.67 18,15.34 18,15V14H20V12H18V11C18,10.66 17.96,10.33 17.91,10H20V8Z"), + DISCORD("M22,24L16.75,19L17.38,21H4.5A2.5,2.5 0 0,1 2,18.5V3.5A2.5,2.5 0 0,1 4.5,1H19.5A2.5,2.5 0 0,1 22,3.5V24M12,6.8C9.32,6.8 7.44,7.95 7.44,7.95C8.47,7.03 10.27,6.5 10.27,6.5L10.1,6.33C8.41,6.36 6.88,7.53 6.88,7.53C5.16,11.12 5.27,14.22 5.27,14.22C6.67,16.03 8.75,15.9 8.75,15.9L9.46,15C8.21,14.73 7.42,13.62 7.42,13.62C7.42,13.62 9.3,14.9 12,14.9C14.7,14.9 16.58,13.62 16.58,13.62C16.58,13.62 15.79,14.73 14.54,15L15.25,15.9C15.25,15.9 17.33,16.03 18.73,14.22C18.73,14.22 18.84,11.12 17.12,7.53C17.12,7.53 15.59,6.36 13.9,6.33L13.73,6.5C13.73,6.5 15.53,7.03 16.56,7.95C16.56,7.95 14.68,6.8 12,6.8M9.93,10.59C10.58,10.59 11.11,11.16 11.1,11.86C11.1,12.55 10.58,13.13 9.93,13.13C9.29,13.13 8.77,12.55 8.77,11.86C8.77,11.16 9.28,10.59 9.93,10.59M14.1,10.59C14.75,10.59 15.27,11.16 15.27,11.86C15.27,12.55 14.75,13.13 14.1,13.13C13.46,13.13 12.94,12.55 12.94,11.86C12.94,11.16 13.45,10.59 14.1,10.59Z"), + LAN("M10,2C8.89,2 8,2.89 8,4V7C8,8.11 8.89,9 10,9H11V11H2V13H6V15H5C3.89,15 3,15.89 3,17V20C3,21.11 3.89,22 5,22H9C10.11,22 11,21.11 11,20V17C11,15.89 10.11,15 9,15H8V13H16V15H15C13.89,15 13,15.89 13,17V20C13,21.11 13.89,22 15,22H19C20.11,22 21,21.11 21,20V17C21,15.89 20.11,15 19,15H18V13H22V11H13V9H14C15.11,9 16,8.11 16,7V4C16,2.89 15.11,2 14,2H10M10,4H14V7H10V4M5,17H9V20H5V17M15,17H19V20H15V17Z"), + THUMB_UP_OUTLINE("M5,9V21H1V9H5M9,21A2,2 0 0,1 7,19V9C7,8.45 7.22,7.95 7.59,7.59L14.17,1L15.23,2.06C15.5,2.33 15.67,2.7 15.67,3.11L15.64,3.43L14.69,8H21C22.11,8 23,8.9 23,10V12C23,12.26 22.95,12.5 22.86,12.73L19.84,19.78C19.54,20.5 18.83,21 18,21H9M9,19H18.03L21,12V10H12.21L13.34,4.68L9,9.03V19Z"), + THUMB_DOWN_OUTLINE("M19,15V3H23V15H19M15,3A2,2 0 0,1 17,5V15C17,15.55 16.78,16.05 16.41,16.41L9.83,23L8.77,21.94C8.5,21.67 8.33,21.3 8.33,20.88L8.36,20.57L9.31,16H3C1.89,16 1,15.1 1,14V12C1,11.74 1.05,11.5 1.14,11.27L4.16,4.22C4.46,3.5 5.17,3 6,3H15M15,5H5.97L3,12V14H11.78L10.65,19.32L15,14.97V5Z"), + SELECT_ALL("M9,9H15V15H9M7,17H17V7H7M15,5H17V3H15M15,21H17V19H15M19,17H21V15H19M19,9H21V7H19M19,21A2,2 0 0,0 21,19H19M19,13H21V11H19M11,21H13V19H11M9,3H7V5H9M3,17H5V15H3M5,21V19H3A2,2 0 0,0 5,21M19,3V5H21A2,2 0 0,0 19,3M13,3H11V5H13M3,9H5V7H3M7,21H9V19H7M3,13H5V11H3M3,5H5V3A2,2 0 0,0 3,5Z"); + + private final String path; + + SVG(String path) { + this.path = path; } - public interface SVGIcon { - Node createIcon(ObjectBinding fill, double width, double height); + public String getPath() { + return path; } - private static Node createSVGPath(String d, ObjectBinding fill, double width, double height) { - SVGPath path = new SVGPath(); - path.getStyleClass().add("svg"); - path.setContent(d); - if (fill != null) - path.fillProperty().bind(fill); - + private static Node createIcon(SVGPath path, double width, double height) { if (width < 0 || height < 0) { StackPane pane = new StackPane(path); pane.setAlignment(Pos.CENTER); @@ -54,490 +136,24 @@ public final class SVG { return svg; } - public static final String ARROW_RIGHT = "M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"; + public Node createIcon(ObservableValue fill, double width, double height) { + SVGPath p = new SVGPath(); + p.getStyleClass().add("svg"); + p.setContent(path); + if (fill != null) + p.fillProperty().bind(fill); - // default fill: white, width: 24, height 24 - - public static Node gear(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z", - fill, width, height); - } - - public static Node gearOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z", - fill, width, height); - } - - public static Node back(ObjectBinding fill, double width, double height) { - return createSVGPath("M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z", fill, width, - height); - } - - public static Node cancel(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z", - fill, width, height); - } - - public static Node close(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", - fill, width, height); - } - - public static Node copy(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z", - fill, width, height); - } - - public static Node dotsVertical(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z", - fill, width, height); - } - - public static Node dotsHorizontal(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z", - fill, width, height); - } - - public static Node delete(ObjectBinding fill, double width, double height) { - return createSVGPath("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", fill, - width, height); - } - - public static Node deleteOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z", - fill, width, height); - } - - public static Node accountEdit(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z", - fill, width, height); - } - - public static Node expand(ObjectBinding fill, double width, double height) { - return createSVGPath("M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z", fill, width, height); - } - - public static Node collapse(ObjectBinding fill, double width, double height) { - return createSVGPath("M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z", fill, width, height); - } - - public static Node navigate(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z", - fill, width, height); - } - - public static Node rocketLaunchOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M13.13 22.19L11.5 18.36C13.07 17.78 14.54 17 15.9 16.09L13.13 22.19M5.64 12.5L1.81 10.87L7.91 8.1C7 9.46 6.22 10.93 5.64 12.5M19.22 4C19.5 4 19.75 4 19.96 4.05C20.13 5.44 19.94 8.3 16.66 11.58C14.96 13.29 12.93 14.6 10.65 15.47L8.5 13.37C9.42 11.06 10.73 9.03 12.42 7.34C15.18 4.58 17.64 4 19.22 4M19.22 2C17.24 2 14.24 2.69 11 5.93C8.81 8.12 7.5 10.53 6.65 12.64C6.37 13.39 6.56 14.21 7.11 14.77L9.24 16.89C9.62 17.27 10.13 17.5 10.66 17.5C10.89 17.5 11.13 17.44 11.36 17.35C13.5 16.53 15.88 15.19 18.07 13C23.73 7.34 21.61 2.39 21.61 2.39S20.7 2 19.22 2M14.54 9.46C13.76 8.68 13.76 7.41 14.54 6.63S16.59 5.85 17.37 6.63C18.14 7.41 18.15 8.68 17.37 9.46C16.59 10.24 15.32 10.24 14.54 9.46M8.88 16.53L7.47 15.12L8.88 16.53M6.24 22L9.88 18.36C9.54 18.27 9.21 18.12 8.91 17.91L4.83 22H6.24M2 22H3.41L8.18 17.24L6.76 15.83L2 20.59V22M2 19.17L6.09 15.09C5.88 14.79 5.73 14.47 5.64 14.12L2 17.76V19.17Z", - fill, width, height); - } - - public static Node launchOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z", - fill, width, height); - } - - public static Node script(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M14,20A2,2 0 0,0 16,18V5H9A1,1 0 0,0 8,6V16H5V5A3,3 0 0,1 8,2H19A3,3 0 0,1 22,5V6H18V18L18,19A3,3 0 0,1 15,22H5A3,3 0 0,1 2,19V18H12A2,2 0 0,0 14,20Z", - fill, width, height); - } - - public static Node pencil(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M20.71,4.04C21.1,3.65 21.1,3 20.71,2.63L18.37,0.29C18,-0.1 17.35,-0.1 16.96,0.29L15,2.25L18.75,6M17.75,7L14,3.25L4,13.25V17H7.75L17.75,7Z", - fill, width, height); - } - - public static Node pencilOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z", - fill, width, height); - } - - public static Node refresh(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z", - fill, width, height); - } - - public static Node folderOpen(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M19,20H4C2.89,20 2,19.1 2,18V6C2,4.89 2.89,4 4,4H10L12,6H19A2,2 0 0,1 21,8H21L4,8V18L6.14,10H23.21L20.93,18.5C20.7,19.37 19.92,20 19,20Z", - fill, width, height); + return createIcon(p, width, height); } - public static Node folderOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z", - fill, width, height); - } - - public static Node update(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M21,10.12H14.22L16.96,7.3C14.23,4.6 9.81,4.5 7.08,7.2C4.35,9.91 4.35,14.28 7.08,17C9.81,19.7 14.23,19.7 16.96,17C18.32,15.65 19,14.08 19,12.1H21C21,14.08 20.12,16.65 18.36,18.39C14.85,21.87 9.15,21.87 5.64,18.39C2.14,14.92 2.11,9.28 5.62,5.81C9.13,2.34 14.76,2.34 18.27,5.81L21,3V10.12M12.5,8V12.25L16,14.33L15.28,15.54L11,13V8H12.5Z", - fill, width, height); - } - - public static Node closeCircle(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z", - fill, width, height); - } - - public static Node checkCircle(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z", - fill, width, height); - } - - public static Node infoCircle(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z", - fill, width, height); - } - - public static Node helpCircle(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z", - fill, width, height); - } - - public static Node helpCircleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z", - fill, width, height); - } - - public static Node alert(ObjectBinding fill, double width, double height) { - return createSVGPath("M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z", fill, width, height); - } - - public static Node alertOutline(ObjectBinding fill, double width, double height) { - return createSVGPath("M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16", fill, width, height); - } - - public static Node plus(ObjectBinding fill, double width, double height) { - return createSVGPath("M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z", fill, width, height); - } - - public static Node plusCircleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z", - fill, width, height); - } - - public static Node importIcon(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M14,12L10,8V11H2V13H10V16M20,18V6C20,4.89 19.1,4 18,4H6A2,2 0 0,0 4,6V9H6V6H18V18H6V15H4V18A2,2 0 0,0 6,20H18A2,2 0 0,0 20,18Z", - fill, width, height); - } - - public static Node export(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M23,12L19,8V11H10V13H19V16M1,18V6C1,4.89 1.9,4 3,4H15A2,2 0 0,1 17,6V9H15V6H3V18H15V15H17V18A2,2 0 0,1 15,20H3A2,2 0 0,1 1,18Z", - fill, width, height); - } - - public static Node openInNew(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z", - fill, width, height); - } - - public static Node triangle(ObjectBinding fill, double width, double height) { - return createSVGPath("M1,21H23L12,2", fill, width, height); - } - - public static Node home(ObjectBinding fill, double width, double height) { - return createSVGPath("M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z", fill, width, height); - } - - public static Node viewList(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z", - fill, width, height); - } - - public static Node check(ObjectBinding fill, double width, double height) { - return createSVGPath("M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z", fill, width, height); - } - - public static Node arrowRight(ObjectBinding fill, double width, double height) { - return createSVGPath(ARROW_RIGHT, fill, width, - height); - } - - public static Node wrench(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M22.7,19L13.6,9.9C14.5,7.6 14,4.9 12.1,3C10.1,1 7.1,0.6 4.7,1.7L9,6L6,9L1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1C4.8,14 7.5,14.5 9.8,13.6L18.9,22.7C19.3,23.1 19.9,23.1 20.3,22.7L22.6,20.4C23.1,20 23.1,19.3 22.7,19Z", - fill, width, height); - } - - public static Node wrenchOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M22.61,19L13.53,9.91C14.46,7.57 14,4.81 12.09,2.91C9.79,0.61 6.21,0.4 3.66,2.26L7.5,6.11L6.08,7.5L2.25,3.69C0.39,6.23 0.6,9.82 2.9,12.11C4.76,13.97 7.47,14.46 9.79,13.59L18.9,22.7C19.29,23.09 19.92,23.09 20.31,22.7L22.61,20.4C23,20 23,19.39 22.61,19M19.61,20.59L10.15,11.13C9.54,11.58 8.86,11.85 8.15,11.95C6.79,12.15 5.36,11.74 4.32,10.7C3.37,9.76 2.93,8.5 3,7.26L6.09,10.35L10.33,6.11L7.24,3C8.5,2.95 9.73,3.39 10.68,4.33C11.76,5.41 12.17,6.9 11.92,8.29C11.8,9 11.5,9.66 11.04,10.25L20.5,19.7L19.61,20.59Z", - fill, width, height); - } + public Node createIcon(Paint fill, double width, double height) { + SVGPath p = new SVGPath(); + p.getStyleClass().add("svg"); + p.setContent(path); + if (fill != null) + p.fillProperty().set(fill); - public static Node upload(ObjectBinding fill, double width, double height) { - return createSVGPath("M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z", fill, width, height); + return createIcon(p, width, height); } - public static Node hanger(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12 4A3.5 3.5 0 0 0 8.5 7.5H10.5A1.5 1.5 0 0 1 12 6A1.5 1.5 0 0 1 13.5 7.5A1.5 1.5 0 0 1 12 9C11.45 9 11 9.45 11 10V11.75L2.4 18.2A1 1 0 0 0 3 20H21A1 1 0 0 0 21.6 18.2L13 11.75V10.85A3.5 3.5 0 0 0 15.5 7.5A3.5 3.5 0 0 0 12 4M12 13.5L18 18H6Z", - fill, width, height); - } - - public static Node puzzle(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M22,13.5C22,15.26 20.7,16.72 19,16.96V20A2,2 0 0,1 17,22H13.2V21.7A2.7,2.7 0 0,0 10.5,19C9,19 7.8,20.21 7.8,21.7V22H4A2,2 0 0,1 2,20V16.2H2.3C3.79,16.2 5,15 5,13.5C5,12 3.79,10.8 2.3,10.8H2V7A2,2 0 0,1 4,5H7.04C7.28,3.3 8.74,2 10.5,2C12.26,2 13.72,3.3 13.96,5H17A2,2 0 0,1 19,7V10.04C20.7,10.28 22,11.74 22,13.5M17,15H18.5A1.5,1.5 0 0,0 20,13.5A1.5,1.5 0 0,0 18.5,12H17V7H12V5.5A1.5,1.5 0 0,0 10.5,4A1.5,1.5 0 0,0 9,5.5V7H4V9.12C5.76,9.8 7,11.5 7,13.5C7,15.5 5.75,17.2 4,17.88V20H6.12C6.8,18.25 8.5,17 10.5,17C12.5,17 14.2,18.25 14.88,20H17V15Z", - fill, width, height); - } - - public static Node cube(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L6.04,7.5L12,10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z", - fill, width, height); - } - - public static Node pack(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L10.11,5.22L16,8.61L17.96,7.5L12,4.15M6.04,7.5L12,10.85L13.96,9.75L8.08,6.35L6.04,7.5M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z", - fill, width, height); - } - - public static Node textureBox(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z", - fill, width, height); - } - - public static Node gamepad(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M6,9H8V11H10V13H8V15H6V13H4V11H6V9M18.5,9A1.5,1.5 0 0,1 20,10.5A1.5,1.5 0 0,1 18.5,12A1.5,1.5 0 0,1 17,10.5A1.5,1.5 0 0,1 18.5,9M15.5,12A1.5,1.5 0 0,1 17,13.5A1.5,1.5 0 0,1 15.5,15A1.5,1.5 0 0,1 14,13.5A1.5,1.5 0 0,1 15.5,12M17,5A7,7 0 0,1 24,12A7,7 0 0,1 17,19C15.04,19 13.27,18.2 12,16.9C10.73,18.2 8.96,19 7,19A7,7 0 0,1 0,12A7,7 0 0,1 7,5H17M7,7A5,5 0 0,0 2,12A5,5 0 0,0 7,17C8.64,17 10.09,16.21 11,15H13C13.91,16.21 15.36,17 17,17A5,5 0 0,0 22,12A5,5 0 0,0 17,7H7Z", - fill, width, height); - } - - public static Node fire(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z", - fill, width, height); - } - - public static Node monitorScreenshot(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M9,6H5V10H7V8H9M19,10H17V12H15V14H19M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2", - fill, width, height); - } - - public static Node texture(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M9.29,21H12.12L21,12.12V9.29M19,21C19.55,21 20.05,20.78 20.41,20.41C20.78,20.05 21,19.55 21,19V17L17,21M5,3A2,2 0 0,0 3,5V7L7,3M11.88,3L3,11.88V14.71L14.71,3M19.5,3.08L3.08,19.5C3.17,19.85 3.35,20.16 3.59,20.41C3.84,20.65 4.15,20.83 4.5,20.92L20.93,4.5C20.74,3.8 20.2,3.26 19.5,3.08Z", - fill, width, height); - } - - public static Node alphaCircleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M11,7H13A2,2 0 0,1 15,9V17H13V13H11V17H9V9A2,2 0 0,1 11,7M11,9V11H13V9H11M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2Z", - fill, width, height); - } - - public static Node betaCircleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M15,10.5C15,11.3 14.3,12 13.5,12C14.3,12 15,12.7 15,13.5V15A2,2 0 0,1 13,17H9V7H13A2,2 0 0,1 15,9V10.5M13,15V13H11V15H13M13,11V9H11V11H13M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z", - fill, width, height); - } - - public static Node releaseCircleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M9,7H13A2,2 0 0,1 15,9V11C15,11.84 14.5,12.55 13.76,12.85L15,17H13L11.8,13H11V17H9V7M11,9V11H13V9H11M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,16.41 7.58,20 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z", - fill, width, height); - } - - public static Node informationOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z", - fill, width, height); - } - - public static Node handHearOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M16 3.23C16.71 2.41 17.61 2 18.7 2C19.61 2 20.37 2.33 21 3C21.63 3.67 21.96 4.43 22 5.3C22 6 21.67 6.81 21 7.76S19.68 9.5 19.03 10.15C18.38 10.79 17.37 11.74 16 13C14.61 11.74 13.59 10.79 12.94 10.15S11.63 8.71 10.97 7.76C10.31 6.81 10 6 10 5.3C10 4.39 10.32 3.63 10.97 3C11.62 2.37 12.4 2.04 13.31 2C14.38 2 15.27 2.41 16 3.23M22 19V20L14 22.5L7 20.56V22H1V11H8.97L15.13 13.3C16.25 13.72 17 14.8 17 16H19C20.66 16 22 17.34 22 19M5 20V13H3V20H5M19.9 18.57C19.74 18.24 19.39 18 19 18H13.65C13.11 18 12.58 17.92 12.07 17.75L9.69 16.96L10.32 15.06L12.7 15.85C13 15.95 15 16 15 16C15 15.63 14.77 15.3 14.43 15.17L8.61 13H7V18.5L13.97 20.41L19.9 18.57Z", - fill, width, height); - } - - public static Node mojang(ObjectBinding fill, double width, double height) { - return createSVGPath( - "m 13.965847,0 c -1.010612,0.82802228 -1.197232,2.1950303 -1.265172,3.4179557 0.02123,1.0021189 1.341654,1.2994159 1.953117,0.590289 C 15.091158,2.6579315 14.369242,1.2738804 13.965847,0 Z M 10.913012,2.9296764 C 10.755901,3.6982508 10.628413,4.4668999 10.492533,5.2354744 8.9893533,3.9913178 7.1504705,3.0824837 5.1419856,3.2947971 3.4944341,3.4646478 0.94293227,2.6961479 0.14038761,4.645185 -0.12288102,8.3139606 0.07223999,12.01236 0.03402357,15.689629 c -0.12314178,1.222925 0.86170213,2.420422 2.14407513,2.280295 4.2207899,0.03397 8.4502143,0.04723 12.6710043,-0.0038 1.265389,0.135918 1.957646,-1.010748 2.13599,-2.0893 C 13.269608,16.437357 9.1760813,16.929609 5.7111265,15.129192 2.5986124,13.58355 2.246023,8.3138817 5.5581114,6.7979639 9.3203049,5.1758896 13.859607,8.0382886 14.942405,11.787743 15.613316,12.11046 16.284433,12.424684 16.95959,12.743154 16.624135,10.348258 16.653651,7.800456 15.579346,5.5881508 15.057054,4.7473897 14.097531,6.2714182 13.379911,5.6217388 12.416008,4.865903 11.749527,3.8128948 10.913012,2.9296713 Z", - fill, width, height); - } - - public static Node microsoft(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z", - fill, width, height); - } - - public static Node accountOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M12,13C14.67,13 20,14.33 20,17V20H4V17C4,14.33 9.33,13 12,13M12,14.9C9.03,14.9 5.9,16.36 5.9,17V18.1H18.1V17C18.1,16.36 14.97,14.9 12,14.9Z", - fill, width, height); - } - - public static Node accountGroupOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,5A3.5,3.5 0 0,0 8.5,8.5A3.5,3.5 0 0,0 12,12A3.5,3.5 0 0,0 15.5,8.5A3.5,3.5 0 0,0 12,5M12,7A1.5,1.5 0 0,1 13.5,8.5A1.5,1.5 0 0,1 12,10A1.5,1.5 0 0,1 10.5,8.5A1.5,1.5 0 0,1 12,7M5.5,8A2.5,2.5 0 0,0 3,10.5C3,11.44 3.53,12.25 4.29,12.68C4.65,12.88 5.06,13 5.5,13C5.94,13 6.35,12.88 6.71,12.68C7.08,12.47 7.39,12.17 7.62,11.81C6.89,10.86 6.5,9.7 6.5,8.5C6.5,8.41 6.5,8.31 6.5,8.22C6.2,8.08 5.86,8 5.5,8M18.5,8C18.14,8 17.8,8.08 17.5,8.22C17.5,8.31 17.5,8.41 17.5,8.5C17.5,9.7 17.11,10.86 16.38,11.81C16.5,12 16.63,12.15 16.78,12.3C16.94,12.45 17.1,12.58 17.29,12.68C17.65,12.88 18.06,13 18.5,13C18.94,13 19.35,12.88 19.71,12.68C20.47,12.25 21,11.44 21,10.5A2.5,2.5 0 0,0 18.5,8M12,14C9.66,14 5,15.17 5,17.5V19H19V17.5C19,15.17 14.34,14 12,14M4.71,14.55C2.78,14.78 0,15.76 0,17.5V19H3V17.07C3,16.06 3.69,15.22 4.71,14.55M19.29,14.55C20.31,15.22 21,16.06 21,17.07V19H24V17.5C24,15.76 21.22,14.78 19.29,14.55M12,16C13.53,16 15.24,16.5 16.23,17H7.77C8.76,16.5 10.47,16 12,16Z", - fill, width, height); - } - - public static Node accountArrowRightOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M19,21V19H15V17H19V15L22,18L19,21M13,18C13,18.71 13.15,19.39 13.42,20H2V17C2,14.79 5.58,13 10,13C11,13 11.96,13.09 12.85,13.26C13.68,13.42 14.44,13.64 15.11,13.92C13.83,14.83 13,16.32 13,18M4,17V18H11C11,16.96 11.23,15.97 11.64,15.08L10,15C6.69,15 4,15.9 4,17M10,4A4,4 0 0,1 14,8A4,4 0 0,1 10,12A4,4 0 0,1 6,8A4,4 0 0,1 10,4M10,6A2,2 0 0,0 8,8A2,2 0 0,0 10,10A2,2 0 0,0 12,8A2,2 0 0,0 10,6Z", - fill, width, height); - } - - public static Node styleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M2.5 19.6L3.8 20.2V11.2L1.4 17C1 18.1 1.5 19.2 2.5 19.6M15.2 4.8L20.2 16.8L12.9 19.8L7.9 7.9V7.8L15.2 4.8M15.3 2.8C15 2.8 14.8 2.8 14.5 2.9L7.1 6C6.4 6.3 5.9 7 5.9 7.8C5.9 8 5.9 8.3 6 8.6L11 20.5C11.3 21.3 12 21.7 12.8 21.7C13.1 21.7 13.3 21.7 13.6 21.6L21 18.5C22 18.1 22.5 16.9 22.1 15.9L17.1 4C16.8 3.2 16 2.8 15.3 2.8M10.5 9.9C9.9 9.9 9.5 9.5 9.5 8.9S9.9 7.9 10.5 7.9C11.1 7.9 11.5 8.4 11.5 8.9S11.1 9.9 10.5 9.9M5.9 19.8C5.9 20.9 6.8 21.8 7.9 21.8H9.3L5.9 13.5V19.8Z", - fill, width, height); - } - - public static Node downloadOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M13,5V11H14.17L12,13.17L9.83,11H11V5H13M15,3H9V9H5L12,16L19,9H15V3M19,18H5V20H19V18Z", - fill, width, height); - } - - public static Node applicationOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 20H3V6H21V20Z", - fill, width, height); - } - - public static Node earth(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z", - fill, width, height); - } - - public static Node bell(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21", - fill, width, height); - } - - public static Node contentSaveMoveOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M13 17H17V14L22 18.5L17 23V20H13V17M14 12.8C13.5 12.31 12.78 12 12 12C10.34 12 9 13.34 9 15C9 16.31 9.84 17.41 11 17.82C11.07 15.67 12.27 13.8 14 12.8M11.09 19H5V5H16.17L19 7.83V12.35C19.75 12.61 20.42 13 21 13.54V7L17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H11.81C11.46 20.39 11.21 19.72 11.09 19M6 10H15V6H6V10Z", - fill, width, height); - } - - public static Node account(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z", - fill, width, height); - } - - public static Node server(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M13,19H14A1,1 0 0,1 15,20H22V22H15A1,1 0 0,1 14,23H10A1,1 0 0,1 9,22H2V20H9A1,1 0 0,1 10,19H11V17H4A1,1 0 0,1 3,16V12A1,1 0 0,1 4,11H20A1,1 0 0,1 21,12V16A1,1 0 0,1 20,17H13V19M4,3H20A1,1 0 0,1 21,4V8A1,1 0 0,1 20,9H4A1,1 0 0,1 3,8V4A1,1 0 0,1 4,3M9,7H10V5H9V7M9,15H10V13H9V15M5,5V7H7V5H5M5,13V15H7V13H5Z", - fill, width, height); - } - - public static Node messageAlertOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M13,10H11V6H13V10M13,12H11V14H13V12M22,4V16A2,2 0 0,1 20,18H6L2,22V4A2,2 0 0,1 4,2H20A2,2 0 0,1 22,4M20,4H4V17.2L5.2,16H20V4Z", - fill, width, height); - } - - public static Node checkCircleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z", - fill, width, height); - } - - public static Node closeCircleOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z", - fill, width, height); - } - - public static Node clockOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z", - fill, width, height); - } - - public static Node magnify(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z", - fill, width, height); - } - - public static Node menuUp(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M7,15L12,10L17,15H7Z", - fill, width, height); - } - - public static Node menuDown(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M7,10L12,15L17,10H7Z", - fill, width, height); - } - - public static Node restore(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z", - fill, width, height); - } - - public static Node bug(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M14,12H10V10H14M14,16H10V14H14M20,8H17.19C16.74,7.22 16.12,6.55 15.37,6.04L17,4.41L15.59,3L13.42,5.17C12.96,5.06 12.5,5 12,5C11.5,5 11.04,5.06 10.59,5.17L8.41,3L7,4.41L8.62,6.04C7.88,6.55 7.26,7.22 6.81,8H4V10H6.09C6.04,10.33 6,10.66 6,11V12H4V14H6V15C6,15.34 6.04,15.67 6.09,16H4V18H6.81C7.85,19.79 9.78,21 12,21C14.22,21 16.15,19.79 17.19,18H20V16H17.91C17.96,15.67 18,15.34 18,15V14H20V12H18V11C18,10.66 17.96,10.33 17.91,10H20V8Z", - fill, width, height); - } - - public static Node discord(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M22,24L16.75,19L17.38,21H4.5A2.5,2.5 0 0,1 2,18.5V3.5A2.5,2.5 0 0,1 4.5,1H19.5A2.5,2.5 0 0,1 22,3.5V24M12,6.8C9.32,6.8 7.44,7.95 7.44,7.95C8.47,7.03 10.27,6.5 10.27,6.5L10.1,6.33C8.41,6.36 6.88,7.53 6.88,7.53C5.16,11.12 5.27,14.22 5.27,14.22C6.67,16.03 8.75,15.9 8.75,15.9L9.46,15C8.21,14.73 7.42,13.62 7.42,13.62C7.42,13.62 9.3,14.9 12,14.9C14.7,14.9 16.58,13.62 16.58,13.62C16.58,13.62 15.79,14.73 14.54,15L15.25,15.9C15.25,15.9 17.33,16.03 18.73,14.22C18.73,14.22 18.84,11.12 17.12,7.53C17.12,7.53 15.59,6.36 13.9,6.33L13.73,6.5C13.73,6.5 15.53,7.03 16.56,7.95C16.56,7.95 14.68,6.8 12,6.8M9.93,10.59C10.58,10.59 11.11,11.16 11.1,11.86C11.1,12.55 10.58,13.13 9.93,13.13C9.29,13.13 8.77,12.55 8.77,11.86C8.77,11.16 9.28,10.59 9.93,10.59M14.1,10.59C14.75,10.59 15.27,11.16 15.27,11.86C15.27,12.55 14.75,13.13 14.1,13.13C13.46,13.13 12.94,12.55 12.94,11.86C12.94,11.16 13.45,10.59 14.1,10.59Z", - fill, width, height); - } - - public static Node lan(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M10,2C8.89,2 8,2.89 8,4V7C8,8.11 8.89,9 10,9H11V11H2V13H6V15H5C3.89,15 3,15.89 3,17V20C3,21.11 3.89,22 5,22H9C10.11,22 11,21.11 11,20V17C11,15.89 10.11,15 9,15H8V13H16V15H15C13.89,15 13,15.89 13,17V20C13,21.11 13.89,22 15,22H19C20.11,22 21,21.11 21,20V17C21,15.89 20.11,15 19,15H18V13H22V11H13V9H14C15.11,9 16,8.11 16,7V4C16,2.89 15.11,2 14,2H10M10,4H14V7H10V4M5,17H9V20H5V17M15,17H19V20H15V17Z", - fill, width, height); - } - - public static Node thumbUpOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M5,9V21H1V9H5M9,21A2,2 0 0,1 7,19V9C7,8.45 7.22,7.95 7.59,7.59L14.17,1L15.23,2.06C15.5,2.33 15.67,2.7 15.67,3.11L15.64,3.43L14.69,8H21C22.11,8 23,8.9 23,10V12C23,12.26 22.95,12.5 22.86,12.73L19.84,19.78C19.54,20.5 18.83,21 18,21H9M9,19H18.03L21,12V10H12.21L13.34,4.68L9,9.03V19Z", - fill, width, height); - } - - public static Node thumbDownOutline(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M19,15V3H23V15H19M15,3A2,2 0 0,1 17,5V15C17,15.55 16.78,16.05 16.41,16.41L9.83,23L8.77,21.94C8.5,21.67 8.33,21.3 8.33,20.88L8.36,20.57L9.31,16H3C1.89,16 1,15.1 1,14V12C1,11.74 1.05,11.5 1.14,11.27L4.16,4.22C4.46,3.5 5.17,3 6,3H15M15,5H5.97L3,12V14H11.78L10.65,19.32L15,14.97V5Z", - fill, width, height); - } - - public static Node selectAll(ObjectBinding fill, double width, double height) { - return createSVGPath( - "M9,9H15V15H9M7,17H17V7H7M15,5H17V3H15M15,21H17V19H15M19,17H21V15H19M19,9H21V7H19M19,21A2,2 0 0,0 21,19H19M19,13H21V11H19M11,21H13V19H11M9,3H7V5H9M3,17H5V15H3M5,21V19H3A2,2 0 0,0 5,21M19,3V5H21A2,2 0 0,0 19,3M13,3H11V5H13M3,9H5V7H3M7,21H9V19H7M3,13H5V11H3M3,5H5V3A2,2 0 0,0 3,5Z", - fill, width, height); - } } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/ToolbarListPageSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/ToolbarListPageSkin.java index e64ff5336..518ceb2f0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/ToolbarListPageSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/ToolbarListPageSkin.java @@ -85,30 +85,30 @@ public abstract class ToolbarListPageSkin return stackPane; } - public static JFXButton createToolbarButton(String text, SVG.SVGIcon creator, Runnable onClick) { + public static JFXButton createToolbarButton(String text, SVG svg, Runnable onClick) { JFXButton ret = new JFXButton(); ret.getStyleClass().add("jfx-tool-bar-button"); ret.textFillProperty().bind(Theme.foregroundFillBinding()); - ret.setGraphic(wrap(creator.createIcon(Theme.foregroundFillBinding(), -1, -1))); + ret.setGraphic(wrap(svg.createIcon(Theme.foregroundFillBinding(), -1, -1))); ret.setText(text); ret.setOnMouseClicked(e -> onClick.run()); return ret; } - public static JFXButton createToolbarButton2(String text, SVG.SVGIcon creator, Runnable onClick) { + public static JFXButton createToolbarButton2(String text, SVG svg, Runnable onClick) { JFXButton ret = new JFXButton(); ret.getStyleClass().add("jfx-tool-bar-button"); - ret.setGraphic(wrap(creator.createIcon(Theme.blackFillBinding(), -1, -1))); + ret.setGraphic(wrap(svg.createIcon(Theme.blackFill(), -1, -1))); ret.setText(text); ret.setOnMouseClicked(e -> onClick.run()); return ret; } - public static JFXButton createDecoratorButton(String tooltip, SVG.SVGIcon creator, Runnable onClick) { + public static JFXButton createDecoratorButton(String tooltip, SVG svg, Runnable onClick) { JFXButton ret = new JFXButton(); ret.getStyleClass().add("jfx-decorator-button"); ret.textFillProperty().bind(Theme.foregroundFillBinding()); - ret.setGraphic(wrap(creator.createIcon(Theme.foregroundFillBinding(), -1, -1))); + ret.setGraphic(wrap(svg.createIcon(Theme.foregroundFillBinding(), -1, -1))); FXUtils.installFastTooltip(ret, tooltip); ret.setOnMouseClicked(e -> onClick.run()); return ret; diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java index 604eda157..2e69fbc17 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java @@ -117,10 +117,10 @@ public class AccountListItemSkin extends SkinBase { }); btnMove.getStyleClass().add("toggle-icon4"); if (skinnable.getAccount().isPortable()) { - btnMove.setGraphic(SVG.earth(Theme.blackFillBinding(), -1, -1)); + btnMove.setGraphic(SVG.EARTH.createIcon(Theme.blackFill(), -1, -1)); runInFX(() -> FXUtils.installFastTooltip(btnMove, i18n("account.move_to_global"))); } else { - btnMove.setGraphic(SVG.export(Theme.blackFillBinding(), -1, -1)); + btnMove.setGraphic(SVG.EXPORT.createIcon(Theme.blackFill(), -1, -1)); runInFX(() -> FXUtils.installFastTooltip(btnMove, i18n("account.move_to_portable"))); } spinnerMove.setContent(btnMove); @@ -142,7 +142,7 @@ public class AccountListItemSkin extends SkinBase { .start(); }); btnRefresh.getStyleClass().add("toggle-icon4"); - btnRefresh.setGraphic(SVG.refresh(Theme.blackFillBinding(), -1, -1)); + btnRefresh.setGraphic(SVG.REFRESH.createIcon(Theme.blackFill(), -1, -1)); runInFX(() -> FXUtils.installFastTooltip(btnRefresh, i18n("button.refresh"))); spinnerRefresh.setContent(btnRefresh); right.getChildren().add(spinnerRefresh); @@ -159,7 +159,7 @@ public class AccountListItemSkin extends SkinBase { } }); btnUpload.getStyleClass().add("toggle-icon4"); - btnUpload.setGraphic(SVG.hanger(Theme.blackFillBinding(), -1, -1)); + btnUpload.setGraphic(SVG.HANGER.createIcon(Theme.blackFill(), -1, -1)); runInFX(() -> FXUtils.installFastTooltip(btnUpload, i18n("account.skin.upload"))); spinnerUpload.managedProperty().bind(spinnerUpload.visibleProperty()); spinnerUpload.visibleProperty().bind(skinnable.canUploadSkin()); @@ -171,7 +171,7 @@ public class AccountListItemSkin extends SkinBase { SpinnerPane spinnerCopyUUID = new SpinnerPane(); spinnerCopyUUID.getStyleClass().add("small-spinner-pane"); btnCopyUUID.setOnMouseClicked(e -> FXUtils.copyText(skinnable.getAccount().getUUID().toString())); - btnCopyUUID.setGraphic(SVG.copy(Theme.blackFillBinding(), -1, -1)); + btnCopyUUID.setGraphic(SVG.COPY.createIcon(Theme.blackFill(), -1, -1)); runInFX(() -> FXUtils.installFastTooltip(btnCopyUUID, i18n("account.copy_uuid"))); spinnerCopyUUID.setContent(btnCopyUUID); right.getChildren().add(spinnerCopyUUID); @@ -180,7 +180,7 @@ public class AccountListItemSkin extends SkinBase { btnRemove.setOnMouseClicked(e -> skinnable.remove()); btnRemove.getStyleClass().add("toggle-icon4"); BorderPane.setAlignment(btnRemove, Pos.CENTER); - btnRemove.setGraphic(SVG.delete(Theme.blackFillBinding(), -1, -1)); + btnRemove.setGraphic(SVG.DELETE.createIcon(Theme.blackFill(), -1, -1)); runInFX(() -> FXUtils.installFastTooltip(btnRemove, i18n("button.delete"))); right.getChildren().add(btnRemove); root.setRight(right); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListPage.java index 9e8e4fac7..876fbac00 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListPage.java @@ -103,7 +103,7 @@ public class AccountListPage extends DecoratorAnimatedPage implements DecoratorP offlineItem.getStyleClass().add("navigation-drawer-item"); offlineItem.setActionButtonVisible(false); offlineItem.setTitle(i18n("account.methods.offline")); - offlineItem.setLeftGraphic(wrap(SVG::account)); + offlineItem.setLeftGraphic(wrap(SVG.ACCOUNT)); offlineItem.setOnAction(e -> Controllers.dialog(new CreateAccountPane(Accounts.FACTORY_OFFLINE))); boxMethods.getChildren().add(offlineItem); @@ -111,7 +111,7 @@ public class AccountListPage extends DecoratorAnimatedPage implements DecoratorP mojangItem.getStyleClass().add("navigation-drawer-item"); mojangItem.setActionButtonVisible(false); mojangItem.setTitle(i18n("account.methods.yggdrasil")); - mojangItem.setLeftGraphic(wrap(SVG::mojang)); + mojangItem.setLeftGraphic(wrap(SVG.MOJANG)); mojangItem.setOnAction(e -> Controllers.dialog(new CreateAccountPane(Accounts.FACTORY_MOJANG))); boxMethods.getChildren().add(mojangItem); @@ -119,7 +119,7 @@ public class AccountListPage extends DecoratorAnimatedPage implements DecoratorP microsoftItem.getStyleClass().add("navigation-drawer-item"); microsoftItem.setActionButtonVisible(false); microsoftItem.setTitle(i18n("account.methods.microsoft")); - microsoftItem.setLeftGraphic(wrap(SVG::microsoft)); + microsoftItem.setLeftGraphic(wrap(SVG.MICROSOFT)); microsoftItem.setOnAction(e -> Controllers.dialog(new CreateAccountPane(Accounts.FACTORY_MICROSOFT))); boxMethods.getChildren().add(microsoftItem); @@ -127,7 +127,7 @@ public class AccountListPage extends DecoratorAnimatedPage implements DecoratorP authServerItems = MappedObservableList.create(skinnable.authServersProperty(), server -> { AdvancedListItem item = new AdvancedListItem(); item.getStyleClass().add("navigation-drawer-item"); - item.setLeftGraphic(wrap(SVG::server)); + item.setLeftGraphic(wrap(SVG.SERVER)); item.setOnAction(e -> Controllers.dialog(new CreateAccountPane(server))); JFXButton btnRemove = new JFXButton(); @@ -136,7 +136,7 @@ public class AccountListPage extends DecoratorAnimatedPage implements DecoratorP e.consume(); }); btnRemove.getStyleClass().add("toggle-icon4"); - btnRemove.setGraphic(SVG.close(Theme.blackFillBinding(), 14, 14)); + btnRemove.setGraphic(SVG.CLOSE.createIcon(Theme.blackFill(), 14, 14)); item.setRightGraphic(btnRemove); ObservableValue title = BindingMapping.of(server, AuthlibInjectorServer::getName); @@ -164,7 +164,7 @@ public class AccountListPage extends DecoratorAnimatedPage implements DecoratorP addAuthServerItem.setTitle(i18n("account.injector.add")); addAuthServerItem.setSubtitle(i18n("account.methods.authlib_injector")); addAuthServerItem.setActionButtonVisible(false); - addAuthServerItem.setLeftGraphic(wrap(SVG::plusCircleOutline)); + addAuthServerItem.setLeftGraphic(wrap(SVG.PLUS_CIRCLE_OUTLINE)); addAuthServerItem.setOnAction(e -> Controllers.dialog(new AddAuthlibInjectorServerPane())); VBox.setMargin(addAuthServerItem, new Insets(0, 0, 12, 0)); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java index 08e12ea71..06c6763a0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java @@ -478,7 +478,7 @@ public class CreateAccountPane extends JFXDialogLayout implements DialogAware { linksContainer.setMinWidth(USE_PREF_SIZE); JFXButton btnAddServer = new JFXButton(); - btnAddServer.setGraphic(SVG.plus(Theme.blackFillBinding(), 20, 20)); + btnAddServer.setGraphic(SVG.PLUS.createIcon(Theme.blackFill(), 20, 20)); btnAddServer.getStyleClass().add("toggle-icon4"); btnAddServer.setOnAction(e -> { Controllers.dialog(new AddAuthlibInjectorServerPane()); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java index ed9dc7314..d6f2a5f5c 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ComponentListCell.java @@ -85,7 +85,7 @@ final class ComponentListCell extends StackPane { VBox groupNode = new VBox(); - Node expandIcon = SVG.expand(Theme.blackFillBinding(), 20, 20); + Node expandIcon = SVG.EXPAND.createIcon(Theme.blackFill(), 20, 20); JFXButton expandButton = new JFXButton(); expandButton.setGraphic(expandIcon); expandButton.getStyleClass().add("options-list-item-expand-button"); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileItem.java index 83f2c5532..7a636c58a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileItem.java @@ -58,7 +58,7 @@ public class FileItem extends BorderPane { setLeft(left); JFXButton right = new JFXButton(); - right.setGraphic(SVG.pencil(Theme.blackFillBinding(), 15, 15)); + right.setGraphic(SVG.PENCIL.createIcon(Theme.blackFill(), 15, 15)); right.getStyleClass().add("toggle-icon4"); right.setOnMouseClicked(e -> onExplore()); FXUtils.installFastTooltip(right, i18n("button.edit")); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileSelector.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileSelector.java index ccc2c74e0..73b5fcc05 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileSelector.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/FileSelector.java @@ -81,7 +81,7 @@ public class FileSelector extends HBox { FXUtils.bindString(customField, valueProperty()); JFXButton selectButton = new JFXButton(); - selectButton.setGraphic(SVG.folderOpen(Theme.blackFillBinding(), 15, 15)); + selectButton.setGraphic(SVG.FOLDER_OPEN.createIcon(Theme.blackFill(), 15, 15)); selectButton.setOnAction(e -> { if (directory) { DirectoryChooser chooser = new DirectoryChooser(); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/HintPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/HintPane.java index 4026da5fe..d2a1e29fb 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/HintPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/HintPane.java @@ -45,31 +45,30 @@ public class HintPane extends VBox { public HintPane(MessageDialogPane.MessageType type) { setFillWidth(true); getStyleClass().addAll("hint", type.name().toLowerCase(Locale.ROOT)); - HBox hbox = new HBox(); - hbox.setAlignment(Pos.CENTER_LEFT); + SVG svg; switch (type) { case INFO: - hbox.getChildren().add(SVG.informationOutline(Theme.blackFillBinding(), 16, 16)); + svg = SVG.INFORMATION_OUTLINE; break; case ERROR: - hbox.getChildren().add(SVG.closeCircleOutline(Theme.blackFillBinding(), 16, 16)); + svg = SVG.CLOSE_CIRCLE_OUTLINE; break; case SUCCESS: - hbox.getChildren().add(SVG.checkCircleOutline(Theme.blackFillBinding(), 16, 16)); + svg = SVG.CHECK_CIRCLE_OUTLINE; break; case WARNING: - hbox.getChildren().add(SVG.alertOutline(Theme.blackFillBinding(), 16, 16)); + svg = SVG.ALERT_OUTLINE; break; case QUESTION: - hbox.getChildren().add(SVG.helpCircleOutline(Theme.blackFillBinding(), 16, 16)); + svg = SVG.HELP_CIRCLE_OUTLINE; break; default: throw new IllegalArgumentException("Unrecognized message box message type " + type); } - - hbox.getChildren().add(new Text(type.getDisplayName())); + HBox hbox = new HBox(svg.createIcon(Theme.blackFill(), 16, 16), new Text(type.getDisplayName())); + hbox.setAlignment(Pos.CENTER_LEFT); flow.getChildren().setAll(label); getChildren().setAll(hbox, flow); label.textProperty().bind(text); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedMenuItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedMenuItem.java index 0abb736cf..b54c6f70b 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedMenuItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedMenuItem.java @@ -17,16 +17,26 @@ */ package org.jackhuang.hmcl.ui.construct; -import javafx.scene.Node; +import com.jfoenix.controls.JFXPopup; +import org.jackhuang.hmcl.setting.Theme; import org.jackhuang.hmcl.ui.FXUtils; +import org.jackhuang.hmcl.ui.SVG; public class IconedMenuItem extends IconedItem { - public IconedMenuItem(Node node, String text, Runnable action) { - super(node, text); + public IconedMenuItem(SVG icon, String text, Runnable action, JFXPopup popup) { + super(icon != null ? FXUtils.limitingSize(icon.createIcon(Theme.blackFill(), 14, 14), 14, 14) : null, text); getStyleClass().setAll("iconed-menu-item"); - setOnMouseClicked(e -> action.run()); + + if (popup == null) { + setOnMouseClicked(e -> action.run()); + } else { + setOnMouseClicked(e -> { + action.run(); + popup.hide(); + }); + } } public IconedMenuItem addTooltip(String tooltip) { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedTwoLineListItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedTwoLineListItem.java index 750750982..f3f9f2d60 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedTwoLineListItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/IconedTwoLineListItem.java @@ -32,7 +32,7 @@ public class IconedTwoLineListItem extends HBox { private final Lazy externalLinkButton = new Lazy<>(() -> { JFXButton button = new JFXButton(); button.getStyleClass().add("toggle-icon4"); - button.setGraphic(SVG.openInNew(Theme.blackFillBinding(), -1, -1)); + button.setGraphic(SVG.OPEN_IN_NEW.createIcon(Theme.blackFill(), -1, -1)); button.setOnAction(e -> FXUtils.openLink(externalLink.get())); return button; }); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ImagePickerItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ImagePickerItem.java index c37fccb69..e7a0a6d00 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ImagePickerItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ImagePickerItem.java @@ -54,12 +54,12 @@ public final class ImagePickerItem extends BorderPane { imageView.setPreserveRatio(true); JFXButton selectButton = new JFXButton(); - selectButton.setGraphic(SVG.pencil(Theme.blackFillBinding(), 20, 20)); + selectButton.setGraphic(SVG.PENCIL.createIcon(Theme.blackFill(), 20, 20)); selectButton.onMouseClickedProperty().bind(onSelectButtonClicked); selectButton.getStyleClass().add("toggle-icon4"); JFXButton deleteButton = new JFXButton(); - deleteButton.setGraphic(SVG.close(Theme.blackFillBinding(), 20, 20)); + deleteButton.setGraphic(SVG.CLOSE.createIcon(Theme.blackFill(), 20, 20)); deleteButton.onMouseClickedProperty().bind(onDeleteButtonClicked); deleteButton.getStyleClass().add("toggle-icon4"); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/JFXHyperlink.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/JFXHyperlink.java index 7296219bd..f68af7c03 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/JFXHyperlink.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/JFXHyperlink.java @@ -27,13 +27,13 @@ public class JFXHyperlink extends Hyperlink { public JFXHyperlink() { super(); - setGraphic(SVG.launchOutline(Theme.blackFillBinding(), 16, 16)); + setGraphic(SVG.LAUNCH_OUTLINE.createIcon(Theme.blackFill(), 16, 16)); } public JFXHyperlink(String text) { super(text); - setGraphic(SVG.launchOutline(Theme.blackFillBinding(), 16, 16)); + setGraphic(SVG.LAUNCH_OUTLINE.createIcon(Theme.blackFill(), 16, 16)); } public void setExternalLink(String externalLink) { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MenuUpDownButton.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MenuUpDownButton.java index 26c07aa96..4b69c7a9d 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MenuUpDownButton.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MenuUpDownButton.java @@ -81,8 +81,8 @@ public class MenuUpDownButton extends Control { label.setStyle("-fx-text-fill: black;"); label.textProperty().bind(control.text); - Node up = SVG.menuUp(Theme.blackFillBinding(), 16, 16); - Node down = SVG.menuDown(Theme.blackFillBinding(), 16, 16); + Node up = SVG.MENU_UP.createIcon(Theme.blackFill(), 16, 16); + Node down = SVG.MENU_DOWN.createIcon(Theme.blackFill(), 16, 16); JFXButton button = new JFXButton(); button.setGraphic(content); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java index d212cbe1f..dd70b735b 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MessageDialogPane.java @@ -71,25 +71,27 @@ public final class MessageDialogPane extends HBox { graphic.setTranslateY(10); graphic.setMinSize(40, 40); graphic.setMaxSize(40, 40); + SVG svg; switch (type) { case INFO: - graphic.setGraphic(SVG.infoCircle(Theme.blackFillBinding(), 40, 40)); + svg = SVG.INFO_CIRCLE; break; case ERROR: - graphic.setGraphic(SVG.closeCircle(Theme.blackFillBinding(), 40, 40)); + svg = SVG.CLOSE_CIRCLE; break; case SUCCESS: - graphic.setGraphic(SVG.checkCircle(Theme.blackFillBinding(), 40, 40)); + svg = SVG.CHECK_CIRCLE; break; case WARNING: - graphic.setGraphic(SVG.alert(Theme.blackFillBinding(), 40, 40)); + svg = SVG.ALERT; break; case QUESTION: - graphic.setGraphic(SVG.helpCircle(Theme.blackFillBinding(), 40, 40)); + svg = SVG.HELP_CIRCLE; break; default: throw new IllegalArgumentException("Unrecognized message box message type " + type); } + graphic.setGraphic(svg.createIcon(Theme.blackFill(), 40, 40)); VBox vbox = new VBox(); HBox.setHgrow(vbox, Priority.ALWAYS); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskListPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskListPane.java index 6178dc837..a320a6b58 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskListPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskListPane.java @@ -262,21 +262,21 @@ public final class TaskListPane extends StackPane { BorderPane.setMargin(title, new Insets(0, 0, 0, 8)); setPadding(new Insets(0, 0, 8, 4)); setCenter(title); - setLeft(FXUtils.limitingSize(SVG.dotsHorizontal(Theme.blackFillBinding(), 14, 14), 14, 14)); + setLeft(FXUtils.limitingSize(SVG.DOTS_HORIZONTAL.createIcon(Theme.blackFill(), 14, 14), 14, 14)); } public void begin() { if (started) return; started = true; - setLeft(FXUtils.limitingSize(SVG.arrowRight(Theme.blackFillBinding(), 14, 14), 14, 14)); + setLeft(FXUtils.limitingSize(SVG.ARROW_RIGHT.createIcon(Theme.blackFill(), 14, 14), 14, 14)); } public void fail() { - setLeft(FXUtils.limitingSize(SVG.close(Theme.blackFillBinding(), 14, 14), 14, 14)); + setLeft(FXUtils.limitingSize(SVG.CLOSE.createIcon(Theme.blackFill(), 14, 14), 14, 14)); } public void succeed() { - setLeft(FXUtils.limitingSize(SVG.check(Theme.blackFillBinding(), 14, 14), 14, 14)); + setLeft(FXUtils.limitingSize(SVG.CHECK.createIcon(Theme.blackFill(), 14, 14), 14, 14)); } public void count() { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java index 058dccd5d..04b2aad42 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator/DecoratorSkin.java @@ -195,7 +195,7 @@ public class DecoratorSkin extends SkinBase { buttonsContainer.setMaxHeight(40); { JFXButton btnHelp = new JFXButton(); - btnHelp.setGraphic(SVG.helpCircleOutline(Theme.foregroundFillBinding(), -1, -1)); + btnHelp.setGraphic(SVG.HELP_CIRCLE_OUTLINE.createIcon(Theme.foregroundFillBinding(), -1, -1)); btnHelp.getStyleClass().add("jfx-decorator-button"); btnHelp.setOnAction(e -> FXUtils.openLink("https://docs.hmcl.net/help.html")); @@ -207,7 +207,7 @@ public class DecoratorSkin extends SkinBase { btnMin.setOnAction(e -> skinnable.minimize()); JFXButton btnClose = new JFXButton(); - btnClose.setGraphic(SVG.close(Theme.foregroundFillBinding(), -1, -1)); + btnClose.setGraphic(SVG.CLOSE.createIcon(Theme.foregroundFillBinding(), -1, -1)); btnClose.getStyleClass().add("jfx-decorator-button"); btnClose.setOnAction(e -> skinnable.close()); @@ -234,9 +234,9 @@ public class DecoratorSkin extends SkinBase { if (canBack) { JFXButton backNavButton = new JFXButton(); - backNavButton.setGraphic(SVG.back(Theme.foregroundFillBinding(), -1, -1)); + backNavButton.setGraphic(SVG.BACK.createIcon(Theme.foregroundFillBinding(), -1, -1)); backNavButton.getStyleClass().add("jfx-decorator-button"); - backNavButton.ripplerFillProperty().bind(Theme.whiteFillBinding()); + backNavButton.ripplerFillProperty().set(Theme.whiteFill()); backNavButton.onActionProperty().bind(skinnable.onBackNavButtonActionProperty()); backNavButton.visibleProperty().set(canBack); @@ -245,14 +245,14 @@ public class DecoratorSkin extends SkinBase { if (canClose) { JFXButton closeNavButton = new JFXButton(); - closeNavButton.setGraphic(SVG.close(Theme.foregroundFillBinding(), -1, -1)); + closeNavButton.setGraphic(SVG.CLOSE.createIcon(Theme.foregroundFillBinding(), -1, -1)); closeNavButton.getStyleClass().add("jfx-decorator-button"); - closeNavButton.ripplerFillProperty().bind(Theme.whiteFillBinding()); + closeNavButton.ripplerFillProperty().set(Theme.whiteFill()); closeNavButton.onActionProperty().bind(skinnable.onCloseNavButtonActionProperty()); if (showCloseAsHome) - closeNavButton.setGraphic(SVG.home(Theme.foregroundFillBinding(), -1, -1)); + closeNavButton.setGraphic(SVG.HOME.createIcon(Theme.foregroundFillBinding(), -1, -1)); else - closeNavButton.setGraphic(SVG.close(Theme.foregroundFillBinding(), -1, -1)); + closeNavButton.setGraphic(SVG.CLOSE.createIcon(Theme.foregroundFillBinding(), -1, -1)); navLeft.getChildren().add(closeNavButton); } @@ -291,9 +291,9 @@ public class DecoratorSkin extends SkinBase { HBox navRight = new HBox(); navRight.setAlignment(Pos.CENTER_RIGHT); JFXButton refreshNavButton = new JFXButton(); - refreshNavButton.setGraphic(SVG.refresh(Theme.foregroundFillBinding(), -1, -1)); + refreshNavButton.setGraphic(SVG.REFRESH.createIcon(Theme.foregroundFillBinding(), -1, -1)); refreshNavButton.getStyleClass().add("jfx-decorator-button"); - refreshNavButton.ripplerFillProperty().bind(Theme.whiteFillBinding()); + refreshNavButton.ripplerFillProperty().set(Theme.whiteFill()); refreshNavButton.onActionProperty().bind(skinnable.onRefreshNavButtonActionProperty()); Rectangle separator = new Rectangle(); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java index 109df16b5..09e0a66d3 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java @@ -106,26 +106,26 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage .startCategory(i18n("download.game")) .addNavigationDrawerItem(item -> { item.setTitle(i18n("game")); - item.setLeftGraphic(wrap(SVG::gamepad)); + item.setLeftGraphic(wrap(SVG.GAMEPAD)); item.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(newGameTab)); item.setOnAction(e -> tab.select(newGameTab)); }) .addNavigationDrawerItem(settingsItem -> { settingsItem.setTitle(i18n("modpack")); - settingsItem.setLeftGraphic(wrap(SVG::pack)); + settingsItem.setLeftGraphic(wrap(SVG.PACK)); settingsItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(modpackTab)); settingsItem.setOnAction(e -> tab.select(modpackTab)); }) .startCategory(i18n("download.content")) .addNavigationDrawerItem(item -> { item.setTitle(i18n("mods")); - item.setLeftGraphic(wrap(SVG::puzzle)); + item.setLeftGraphic(wrap(SVG.PUZZLE)); item.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(modTab)); item.setOnAction(e -> tab.select(modTab)); }) .addNavigationDrawerItem(item -> { item.setTitle(i18n("resourcepack")); - item.setLeftGraphic(wrap(SVG::textureBox)); + item.setLeftGraphic(wrap(SVG.TEXTURE_BOX)); item.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(resourcePackTab)); item.setOnAction(e -> tab.select(resourcePackTab)); }) @@ -137,7 +137,7 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage // }) .addNavigationDrawerItem(item -> { item.setTitle(i18n("world")); - item.setLeftGraphic(wrap(SVG::earth)); + item.setLeftGraphic(wrap(SVG.EARTH)); item.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(worldTab)); item.setOnAction(e -> selectTabIfCurseForgeAvailable(worldTab)); }); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/ModpackSelectionPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/ModpackSelectionPage.java index 31987d15f..8687119a8 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/ModpackSelectionPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/ModpackSelectionPage.java @@ -98,7 +98,7 @@ public final class ModpackSelectionPage extends VBox implements WizardPage { graphic.setLeft(new TwoLineListItem(i18n("modpack.choose." + type), i18n("modpack.choose." + type + ".detail"))); SVGPath arrow = new SVGPath(); - arrow.setContent(SVG.ARROW_RIGHT); + arrow.setContent(SVG.ARROW_RIGHT.getPath()); BorderPane.setAlignment(arrow, Pos.CENTER); graphic.setRight(arrow); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/VersionsPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/VersionsPage.java index f69a553a0..f4b08d39e 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/VersionsPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/VersionsPage.java @@ -177,7 +177,7 @@ public final class VersionsPage extends BorderPane implements WizardPage, Refres chkSnapshot.selectedProperty().addListener(listener); chkOld.selectedProperty().addListener(listener); - btnRefresh.setGraphic(wrap(SVG.refresh(Theme.blackFillBinding(), -1, -1))); + btnRefresh.setGraphic(wrap(SVG.REFRESH.createIcon(Theme.blackFill(), -1, -1))); Holder lastCell = new Holder<>(); EnumMap icons = new EnumMap<>(VersionIconType.class); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/export/ModpackTypeSelectionPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/export/ModpackTypeSelectionPage.java index 836c99167..012aae47f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/export/ModpackTypeSelectionPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/export/ModpackTypeSelectionPage.java @@ -72,7 +72,7 @@ public final class ModpackTypeSelectionPage extends VBox implements WizardPage { graphic.setLeft(new TwoLineListItem(i18n("modpack.type." + type), i18n("modpack.type." + type + ".export"))); SVGPath arrow = new SVGPath(); - arrow.setContent(SVG.ARROW_RIGHT); + arrow.setContent(SVG.ARROW_RIGHT.getPath()); BorderPane.setAlignment(arrow, Pos.CENTER); graphic.setRight(arrow); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java index 113b4c6d3..3e80594cc 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/LauncherSettingsPage.java @@ -71,7 +71,7 @@ public class LauncherSettingsPage extends DecoratorAnimatedPage implements Decor AdvancedListBox sideBar = new AdvancedListBox() .addNavigationDrawerItem(settingsItem -> { settingsItem.setTitle(i18n("settings.type.global.manage")); - settingsItem.setLeftGraphic(wrap(SVG::gamepad)); + settingsItem.setLeftGraphic(wrap(SVG.GAMEPAD)); settingsItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(gameTab)); runInFX(() -> FXUtils.installFastTooltip(settingsItem, i18n("settings.type.global.manage"))); settingsItem.setOnAction(e -> tab.select(gameTab)); @@ -79,44 +79,44 @@ public class LauncherSettingsPage extends DecoratorAnimatedPage implements Decor .startCategory(i18n("launcher")) .addNavigationDrawerItem(settingsItem -> { settingsItem.setTitle(i18n("settings.launcher.general")); - settingsItem.setLeftGraphic(wrap(SVG::applicationOutline)); + settingsItem.setLeftGraphic(wrap(SVG.APPLICATION_OUTLINE)); settingsItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(settingsTab)); settingsItem.setOnAction(e -> tab.select(settingsTab)); }) .addNavigationDrawerItem(personalizationItem -> { personalizationItem.setTitle(i18n("settings.launcher.appearance")); - personalizationItem.setLeftGraphic(wrap(SVG::styleOutline)); + personalizationItem.setLeftGraphic(wrap(SVG.STYLE_OUTLINE)); personalizationItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(personalizationTab)); personalizationItem.setOnAction(e -> tab.select(personalizationTab)); }) .addNavigationDrawerItem(downloadItem -> { downloadItem.setTitle(i18n("download")); - downloadItem.setLeftGraphic(wrap(SVG::downloadOutline)); + downloadItem.setLeftGraphic(wrap(SVG.DOWNLOAD_OUTLINE)); downloadItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(downloadTab)); downloadItem.setOnAction(e -> tab.select(downloadTab)); }) .startCategory(i18n("help")) .addNavigationDrawerItem(helpItem -> { helpItem.setTitle(i18n("help")); - helpItem.setLeftGraphic(wrap(SVG::helpCircleOutline)); + helpItem.setLeftGraphic(wrap(SVG.HELP_CIRCLE_OUTLINE)); helpItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(helpTab)); helpItem.setOnAction(e -> tab.select(helpTab)); }) .addNavigationDrawerItem(feedbackItem -> { feedbackItem.setTitle(i18n("feedback")); - feedbackItem.setLeftGraphic(wrap(SVG::messageAlertOutline)); + feedbackItem.setLeftGraphic(wrap(SVG.MESSAGE_ALERT_OUTLINE)); feedbackItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(feedbackTab)); feedbackItem.setOnAction(e -> tab.select(feedbackTab)); }) .addNavigationDrawerItem(sponsorItem -> { sponsorItem.setTitle(i18n("sponsor")); - sponsorItem.setLeftGraphic(wrap(SVG::handHearOutline)); + sponsorItem.setLeftGraphic(wrap(SVG.HAND_HEAR_OUTLINE)); sponsorItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(sponsorTab)); sponsorItem.setOnAction(e -> tab.select(sponsorTab)); }) .addNavigationDrawerItem(aboutItem -> { aboutItem.setTitle(i18n("about")); - aboutItem.setLeftGraphic(wrap(SVG::informationOutline)); + aboutItem.setLeftGraphic(wrap(SVG.INFORMATION_OUTLINE)); aboutItem.activeProperty().bind(tab.getSelectionModel().selectedItemProperty().isEqualTo(aboutTab)); aboutItem.setOnAction(e -> tab.select(aboutTab)); }); 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 7278fc49c..ec1baa0c9 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 @@ -143,7 +143,7 @@ public final class MainPage extends StackPane implements DecoratorPage { StackPane.setMargin(hBox, new Insets(9, 12, 9, 16)); { Label lblIcon = new Label(); - lblIcon.setGraphic(SVG.update(Theme.whiteFillBinding(), 20, 20)); + lblIcon.setGraphic(SVG.UPDATE.createIcon(Theme.whiteFill(), 20, 20)); TwoLineListItem prompt = new TwoLineListItem(); prompt.setSubtitle(i18n("update.bubble.subtitle")); @@ -155,7 +155,7 @@ public final class MainPage extends StackPane implements DecoratorPage { } JFXButton closeUpdateButton = new JFXButton(); - closeUpdateButton.setGraphic(SVG.close(Theme.whiteFillBinding(), 10, 10)); + closeUpdateButton.setGraphic(SVG.CLOSE.createIcon(Theme.whiteFill(), 10, 10)); StackPane.setAlignment(closeUpdateButton, Pos.TOP_RIGHT); closeUpdateButton.getStyleClass().add("toggle-icon-tiny"); StackPane.setMargin(closeUpdateButton, new Insets(5)); @@ -224,7 +224,7 @@ public final class MainPage extends StackPane implements DecoratorPage { menuButton.setOnMouseClicked(e -> onMenu()); menuButton.setClip(new Rectangle(211, -100, 100, 200)); StackPane graphic = new StackPane(); - Node svg = SVG.triangle(Theme.foregroundFillBinding(), 10, 10); + Node svg = SVG.TRIANGLE.createIcon(Theme.foregroundFillBinding(), 10, 10); StackPane.setAlignment(svg, Pos.CENTER_RIGHT); graphic.getChildren().setAll(svg); graphic.setTranslateX(12); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/PersonalizationPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/PersonalizationPage.java index 22e982a00..f1938c8ef 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/PersonalizationPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/PersonalizationPage.java @@ -202,7 +202,7 @@ public class PersonalizationPage extends StackPane { JFXButton clearButton = new JFXButton(); clearButton.getStyleClass().add("toggle-icon4"); - clearButton.setGraphic(SVG.restore(Theme.blackFillBinding(), -1, -1)); + clearButton.setGraphic(SVG.RESTORE.createIcon(Theme.blackFill(), -1, -1)); clearButton.setOnAction(e -> config().setLauncherFontFamily(null)); hBox.getChildren().setAll(cboFont, clearButton); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java index 6298fb3ee..44bd1b692 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/RootPage.java @@ -139,14 +139,14 @@ public class RootPage extends DecoratorAnimatedPage implements DecoratorPage { // third item in left sidebar AdvancedListItem gameItem = new AdvancedListItem(); - gameItem.setLeftGraphic(wrap(SVG::viewList)); + gameItem.setLeftGraphic(wrap(SVG.VIEW_LIST)); gameItem.setActionButtonVisible(false); gameItem.setTitle(i18n("version.manage")); gameItem.setOnAction(e -> Controllers.navigate(Controllers.getGameListPage())); // forth item in left sidebar AdvancedListItem downloadItem = new AdvancedListItem(); - downloadItem.setLeftGraphic(wrap(SVG::downloadOutline)); + downloadItem.setLeftGraphic(wrap(SVG.DOWNLOAD_OUTLINE)); downloadItem.setActionButtonVisible(false); downloadItem.setTitle(i18n("download")); downloadItem.setOnAction(e -> Controllers.navigate(Controllers.getDownloadPage())); @@ -154,7 +154,7 @@ public class RootPage extends DecoratorAnimatedPage implements DecoratorPage { // fifth item in left sidebar AdvancedListItem multiplayerItem = new AdvancedListItem(); - multiplayerItem.setLeftGraphic(wrap(SVG::lan)); + multiplayerItem.setLeftGraphic(wrap(SVG.LAN)); multiplayerItem.setActionButtonVisible(false); multiplayerItem.setTitle(i18n("multiplayer")); JFXHyperlink link = new JFXHyperlink(i18n("multiplayer.hint.details")); @@ -167,7 +167,7 @@ public class RootPage extends DecoratorAnimatedPage implements DecoratorPage { // sixth item in left sidebar AdvancedListItem launcherSettingsItem = new AdvancedListItem(); - launcherSettingsItem.setLeftGraphic(wrap(SVG::gearOutline)); + launcherSettingsItem.setLeftGraphic(wrap(SVG.GEAR_OUTLINE)); launcherSettingsItem.setActionButtonVisible(false); launcherSettingsItem.setTitle(i18n("settings")); launcherSettingsItem.setOnAction(e -> Controllers.navigate(Controllers.getSettingsPage())); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java index af9a3477b..132ea76f6 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsView.java @@ -121,7 +121,7 @@ public abstract class SettingsView extends StackPane { btnUpdate = new JFXButton(); btnUpdate.setOnMouseClicked(e -> onUpdate()); btnUpdate.getStyleClass().add("toggle-icon4"); - btnUpdate.setGraphic(SVG.update(Theme.blackFillBinding(), 20, 20)); + btnUpdate.setGraphic(SVG.UPDATE.createIcon(Theme.blackFill(), 20, 20)); updatePane.setHeaderRight(btnUpdate); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListItemSkin.java index 3713abb69..83b5ed336 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListItemSkin.java @@ -51,7 +51,7 @@ public class ProfileListItemSkin extends SkinBase { getSkinnable().setSelected(true); }); - Node left = VersionPage.wrap(SVG::folderOutline); + Node left = VersionPage.wrap(SVG.FOLDER_OUTLINE); root.setLeft(left); BorderPane.setAlignment(left, Pos.CENTER_LEFT); @@ -67,7 +67,7 @@ public class ProfileListItemSkin extends SkinBase { btnRemove.setOnMouseClicked(e -> skinnable.remove()); btnRemove.getStyleClass().add("toggle-icon4"); BorderPane.setAlignment(btnRemove, Pos.CENTER); - btnRemove.setGraphic(SVG.close(Theme.blackFillBinding(), 14, 14)); + btnRemove.setGraphic(SVG.CLOSE.createIcon(Theme.blackFill(), 14, 14)); right.getChildren().add(btnRemove); root.setRight(right); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPageSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPageSkin.java index 5a2e99d62..4baa9f316 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPageSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DatapackListPageSkin.java @@ -56,16 +56,16 @@ class DatapackListPageSkin extends SkinBase { JFXDepthManager.setDepth(toolbar, 1); toolbar.setPickOnBounds(false); - toolbar.getChildren().add(createToolbarButton(i18n("button.refresh"), SVG::refresh, skinnable::refresh)); - toolbar.getChildren().add(createToolbarButton(i18n("datapack.add"), SVG::plus, skinnable::add)); - toolbar.getChildren().add(createToolbarButton(i18n("button.remove"), SVG::delete, () -> { + toolbar.getChildren().add(createToolbarButton(i18n("button.refresh"), SVG.REFRESH, skinnable::refresh)); + toolbar.getChildren().add(createToolbarButton(i18n("datapack.add"), SVG.PLUS, skinnable::add)); + toolbar.getChildren().add(createToolbarButton(i18n("button.remove"), SVG.DELETE, () -> { Controllers.confirm(i18n("button.remove.confirm"), i18n("button.remove"), () -> { skinnable.removeSelected(listView.getSelectionModel().getSelectedItems()); }, null); })); - toolbar.getChildren().add(createToolbarButton(i18n("mods.enable"), SVG::check, () -> + toolbar.getChildren().add(createToolbarButton(i18n("mods.enable"), SVG.CHECK, () -> skinnable.enableSelected(listView.getSelectionModel().getSelectedItems()))); - toolbar.getChildren().add(createToolbarButton(i18n("mods.disable"), SVG::close, () -> + toolbar.getChildren().add(createToolbarButton(i18n("mods.disable"), SVG.CLOSE, () -> skinnable.disableSelected(listView.getSelectionModel().getSelectedItems()))); root.setTop(toolbar); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java index e20b06a32..f506fd8b2 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java @@ -386,7 +386,7 @@ public class DownloadPage extends Control implements DecoratorPage { getChildren().setAll(container); saveAsButton.getStyleClass().add("toggle-icon4"); - saveAsButton.setGraphic(SVG.contentSaveMoveOutline(Theme.blackFillBinding(), -1, -1)); + saveAsButton.setGraphic(SVG.CONTENT_SAVE_MOVE_OUTLINE.createIcon(Theme.blackFill(), -1, -1)); HBox.setHgrow(content, Priority.ALWAYS); pane.getChildren().setAll(graphicPane, content, saveAsButton); @@ -397,15 +397,15 @@ public class DownloadPage extends Control implements DecoratorPage { switch (dataItem.getVersionType()) { case Release: - graphicPane.getChildren().setAll(SVG.releaseCircleOutline(Theme.blackFillBinding(), 24, 24)); + graphicPane.getChildren().setAll(SVG.RELEASE_CIRCLE_OUTLINE.createIcon(Theme.blackFill(), 24, 24)); content.getTags().add(i18n("version.game.release")); break; case Beta: - graphicPane.getChildren().setAll(SVG.betaCircleOutline(Theme.blackFillBinding(), 24, 24)); + graphicPane.getChildren().setAll(SVG.BETA_CIRCLE_OUTLINE.createIcon(Theme.blackFill(), 24, 24)); content.getTags().add(i18n("version.game.snapshot")); break; case Alpha: - graphicPane.getChildren().setAll(SVG.alphaCircleOutline(Theme.blackFillBinding(), 24, 24)); + graphicPane.getChildren().setAll(SVG.ALPHA_CIRCLE_OUTLINE.createIcon(Theme.blackFill(), 24, 24)); content.getTags().add(i18n("version.game.snapshot")); break; } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java index 99dba9f45..e4e767214 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java @@ -45,17 +45,17 @@ public class GameListItemSkin extends SkinBase { JFXPopup popup = new JFXPopup(menu); menu.getContent().setAll( - new IconedMenuItem(FXUtils.limitingSize(SVG.rocketLaunchOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.launch.test"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.launch(), popup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.script(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.launch_script"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.generateLaunchScript(), popup)), + new IconedMenuItem(SVG.ROCKET_LAUNCH_OUTLINE, i18n("version.launch.test"), () -> currentSkinnable.launch(), popup), + new IconedMenuItem(SVG.SCRIPT, i18n("version.launch_script"), () -> currentSkinnable.generateLaunchScript(), popup), new MenuSeparator(), - new IconedMenuItem(FXUtils.limitingSize(SVG.gearOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.manage.manage"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.modifyGameSettings(), popup)), + new IconedMenuItem(SVG.GEAR_OUTLINE, i18n("version.manage.manage"), () -> currentSkinnable.modifyGameSettings(), popup), new MenuSeparator(), - new IconedMenuItem(FXUtils.limitingSize(SVG.pencilOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.manage.rename"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.rename(), popup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.copy(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.manage.duplicate"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.duplicate(), popup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.deleteOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.manage.remove"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.remove(), popup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.export(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("modpack.export"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.export(), popup)), + new IconedMenuItem(SVG.PENCIL_OUTLINE, i18n("version.manage.rename"), () -> currentSkinnable.rename(), popup), + new IconedMenuItem(SVG.COPY, i18n("version.manage.duplicate"), () -> currentSkinnable.duplicate(), popup), + new IconedMenuItem(SVG.DELETE_OUTLINE, i18n("version.manage.remove"), () -> currentSkinnable.remove(), popup), + new IconedMenuItem(SVG.EXPORT, i18n("modpack.export"), () -> currentSkinnable.export(), popup), new MenuSeparator(), - new IconedMenuItem(FXUtils.limitingSize(SVG.folderOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.game"), FXUtils.withJFXPopupClosing(() -> currentSkinnable.browse(), popup))); + new IconedMenuItem(SVG.FOLDER_OUTLINE, i18n("folder.game"), () -> currentSkinnable.browse(), popup)); return popup; }); @@ -81,7 +81,7 @@ public class GameListItemSkin extends SkinBase { JFXButton btnUpgrade = new JFXButton(); btnUpgrade.setOnMouseClicked(e -> skinnable.update()); btnUpgrade.getStyleClass().add("toggle-icon4"); - btnUpgrade.setGraphic(FXUtils.limitingSize(SVG.update(Theme.blackFillBinding(), 24, 24), 24, 24)); + btnUpgrade.setGraphic(FXUtils.limitingSize(SVG.UPDATE.createIcon(Theme.blackFill(), 24, 24), 24, 24)); runInFX(() -> FXUtils.installFastTooltip(btnUpgrade, i18n("version.update"))); right.getChildren().add(btnUpgrade); } @@ -91,7 +91,7 @@ public class GameListItemSkin extends SkinBase { btnLaunch.setOnMouseClicked(e -> skinnable.launch()); btnLaunch.getStyleClass().add("toggle-icon4"); BorderPane.setAlignment(btnLaunch, Pos.CENTER); - btnLaunch.setGraphic(FXUtils.limitingSize(SVG.rocketLaunchOutline(Theme.blackFillBinding(), 24, 24), 24, 24)); + btnLaunch.setGraphic(FXUtils.limitingSize(SVG.ROCKET_LAUNCH_OUTLINE.createIcon(Theme.blackFill(), 24, 24), 24, 24)); runInFX(() -> FXUtils.installFastTooltip(btnLaunch, i18n("version.launch.test"))); right.getChildren().add(btnLaunch); } @@ -104,7 +104,7 @@ public class GameListItemSkin extends SkinBase { }); btnManage.getStyleClass().add("toggle-icon4"); BorderPane.setAlignment(btnManage, Pos.CENTER); - btnManage.setGraphic(FXUtils.limitingSize(SVG.dotsVertical(Theme.blackFillBinding(), 24, 24), 24, 24)); + btnManage.setGraphic(FXUtils.limitingSize(SVG.DOTS_VERTICAL.createIcon(Theme.blackFill(), 24, 24), 24, 24)); runInFX(() -> FXUtils.installFastTooltip(btnManage, i18n("settings.game.management"))); right.getChildren().add(btnManage); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java index 57d89504c..1482b510a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java @@ -73,7 +73,7 @@ public class GameListPage extends DecoratorAnimatedPage implements DecoratorPage addProfileItem.getStyleClass().add("navigation-drawer-item"); addProfileItem.setTitle(i18n("profile.new")); addProfileItem.setActionButtonVisible(false); - addProfileItem.setLeftGraphic(VersionPage.wrap(SVG::plusCircleOutline)); + addProfileItem.setLeftGraphic(VersionPage.wrap(SVG.PLUS_CIRCLE_OUTLINE)); addProfileItem.setOnAction(e -> Controllers.navigate(new ProfilePage(null))); pane.setFitToWidth(true); @@ -89,24 +89,24 @@ public class GameListPage extends DecoratorAnimatedPage implements DecoratorPage AdvancedListBox bottomLeftCornerList = new AdvancedListBox() .addNavigationDrawerItem(installNewGameItem -> { installNewGameItem.setTitle(i18n("install.new_game")); - installNewGameItem.setLeftGraphic(VersionPage.wrap(SVG::plusCircleOutline)); + installNewGameItem.setLeftGraphic(VersionPage.wrap(SVG.PLUS_CIRCLE_OUTLINE)); installNewGameItem.setOnAction(e -> Versions.addNewGame()); runInFX(() -> FXUtils.installFastTooltip(installNewGameItem, i18n("install.new_game"))); }) .addNavigationDrawerItem(installModpackItem -> { installModpackItem.setTitle(i18n("install.modpack")); - installModpackItem.setLeftGraphic(VersionPage.wrap(SVG::pack)); + installModpackItem.setLeftGraphic(VersionPage.wrap(SVG.PACK)); installModpackItem.setOnAction(e -> Versions.importModpack()); runInFX(() -> FXUtils.installFastTooltip(installModpackItem, i18n("install.modpack"))); }) .addNavigationDrawerItem(refreshItem -> { refreshItem.setTitle(i18n("button.refresh")); - refreshItem.setLeftGraphic(VersionPage.wrap(SVG::refresh)); + refreshItem.setLeftGraphic(VersionPage.wrap(SVG.REFRESH)); refreshItem.setOnAction(e -> gameList.refreshList()); }) .addNavigationDrawerItem(globalManageItem -> { globalManageItem.setTitle(i18n("settings.type.global.manage")); - globalManageItem.setLeftGraphic(VersionPage.wrap(SVG::gearOutline)); + globalManageItem.setLeftGraphic(VersionPage.wrap(SVG.GEAR_OUTLINE)); globalManageItem.setOnAction(e -> modifyGlobalGameSettings()); runInFX(() -> FXUtils.installFastTooltip(globalManageItem, i18n("settings.type.global.manage"))); }); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/InstallerListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/InstallerListPage.java index 5617ab117..f3e66e86f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/InstallerListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/InstallerListPage.java @@ -175,7 +175,7 @@ public class InstallerListPage extends ListPageBase implements Ve @Override protected List initializeToolbar(InstallerListPage skinnable) { return Collections.singletonList( - createToolbarButton2(i18n("install.installer.install_offline"), SVG::plus, skinnable::installOffline)); + createToolbarButton2(i18n("install.installer.install_offline"), SVG.PLUS, skinnable::installOffline)); } } } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java index af461b105..5c3173cd7 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java @@ -116,7 +116,7 @@ class ModListPageSkin extends SkinBase { HBox.setHgrow(searchField, Priority.ALWAYS); searchField.setOnAction(e -> search()); - JFXButton closeSearchBar = createToolbarButton2(null, SVG::close, + JFXButton closeSearchBar = createToolbarButton2(null, SVG.CLOSE, () -> { changeToolbar(toolbarNormal); @@ -129,28 +129,28 @@ class ModListPageSkin extends SkinBase { // Toolbar Normal toolbarNormal.getChildren().setAll( - createToolbarButton2(i18n("button.refresh"), SVG::refresh, skinnable::refresh), - createToolbarButton2(i18n("mods.add"), SVG::plus, skinnable::add), - createToolbarButton2(i18n("folder.mod"), SVG::folderOpen, skinnable::openModFolder), - createToolbarButton2(i18n("mods.check_updates"), SVG::update, skinnable::checkUpdates), - createToolbarButton2(i18n("download"), SVG::downloadOutline, skinnable::download), - createToolbarButton2(i18n("search"), SVG::magnify, () -> changeToolbar(searchBar)) + createToolbarButton2(i18n("button.refresh"), SVG.REFRESH, skinnable::refresh), + createToolbarButton2(i18n("mods.add"), SVG.PLUS, skinnable::add), + createToolbarButton2(i18n("folder.mod"), SVG.FOLDER_OPEN, skinnable::openModFolder), + createToolbarButton2(i18n("mods.check_updates"), SVG.UPDATE, skinnable::checkUpdates), + createToolbarButton2(i18n("download"), SVG.DOWNLOAD_OUTLINE, skinnable::download), + createToolbarButton2(i18n("search"), SVG.MAGNIFY, () -> changeToolbar(searchBar)) ); // Toolbar Selecting toolbarSelecting.getChildren().setAll( - createToolbarButton2(i18n("button.remove"), SVG::delete, () -> { + createToolbarButton2(i18n("button.remove"), SVG.DELETE, () -> { Controllers.confirm(i18n("button.remove.confirm"), i18n("button.remove"), () -> { skinnable.removeSelected(listView.getSelectionModel().getSelectedItems()); }, null); }), - createToolbarButton2(i18n("mods.enable"), SVG::check, () -> + createToolbarButton2(i18n("mods.enable"), SVG.CHECK, () -> skinnable.enableSelected(listView.getSelectionModel().getSelectedItems())), - createToolbarButton2(i18n("mods.disable"), SVG::close, () -> + createToolbarButton2(i18n("mods.disable"), SVG.CLOSE, () -> skinnable.disableSelected(listView.getSelectionModel().getSelectedItems())), - createToolbarButton2(i18n("button.select_all"), SVG::selectAll, () -> + createToolbarButton2(i18n("button.select_all"), SVG.SELECT_ALL, () -> listView.getSelectionModel().selectAll()), - createToolbarButton2(i18n("button.cancel"), SVG::cancel, () -> + createToolbarButton2(i18n("button.cancel"), SVG.CANCEL, () -> listView.getSelectionModel().clearSelection()) ); @@ -429,15 +429,15 @@ class ModListPageSkin extends SkinBase { setSelectable(); restoreButton.getStyleClass().add("toggle-icon4"); - restoreButton.setGraphic(FXUtils.limitingSize(SVG.restore(Theme.blackFillBinding(), 24, 24), 24, 24)); + restoreButton.setGraphic(FXUtils.limitingSize(SVG.RESTORE.createIcon(Theme.blackFill(), 24, 24), 24, 24)); FXUtils.installFastTooltip(restoreButton, i18n("mods.restore")); revealButton.getStyleClass().add("toggle-icon4"); - revealButton.setGraphic(FXUtils.limitingSize(SVG.folderOutline(Theme.blackFillBinding(), 24, 24), 24, 24)); + revealButton.setGraphic(FXUtils.limitingSize(SVG.FOLDER_OUTLINE.createIcon(Theme.blackFill(), 24, 24), 24, 24)); infoButton.getStyleClass().add("toggle-icon4"); - infoButton.setGraphic(FXUtils.limitingSize(SVG.informationOutline(Theme.blackFillBinding(), 24, 24), 24, 24)); + infoButton.setGraphic(FXUtils.limitingSize(SVG.INFORMATION_OUTLINE.createIcon(Theme.blackFill(), 24, 24), 24, 24)); container.getChildren().setAll(checkBox, content, restoreButton, revealButton, infoButton); @@ -462,10 +462,9 @@ class ModListPageSkin extends SkinBase { restoreButton.setVisible(!dataItem.getModInfo().getMod().getOldFiles().isEmpty()); restoreButton.setOnMouseClicked(e -> { menu.get().getContent().setAll(dataItem.getModInfo().getMod().getOldFiles().stream() - .map(localModFile -> new IconedMenuItem(null, localModFile.getVersion(), () -> { - popup.get().hide(); - getSkinnable().rollback(dataItem.getModInfo(), localModFile); - })) + .map(localModFile -> new IconedMenuItem(null, localModFile.getVersion(), + () -> getSkinnable().rollback(dataItem.getModInfo(), localModFile), + popup.get())) .collect(Collectors.toList()) ); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionIconDialog.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionIconDialog.java index f0fb2b619..a323c23ae 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionIconDialog.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionIconDialog.java @@ -92,7 +92,7 @@ public class VersionIconDialog extends DialogPane { } private Node createCustomIcon() { - Node shape = SVG.plusCircleOutline(Theme.blackFillBinding(), 32, 32); + Node shape = SVG.PLUS_CIRCLE_OUTLINE.createIcon(Theme.blackFill(), 32, 32); shape.setMouseTransparent(true); RipplerContainer container = new RipplerContainer(shape); FXUtils.setLimitWidth(container, 36); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java index da8437971..b641a73ff 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java @@ -28,12 +28,12 @@ import javafx.scene.layout.BorderPane; import javafx.scene.layout.Priority; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; +import javafx.scene.paint.Paint; import org.jackhuang.hmcl.event.EventBus; import org.jackhuang.hmcl.event.EventPriority; import org.jackhuang.hmcl.event.RefreshedVersionsEvent; import org.jackhuang.hmcl.game.GameRepository; import org.jackhuang.hmcl.setting.Profile; -import org.jackhuang.hmcl.setting.Theme; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.SVG; import org.jackhuang.hmcl.ui.WeakListenerHolder; @@ -236,7 +236,7 @@ public class VersionPage extends DecoratorAnimatedPage implements DecoratorPage AdvancedListItem versionSettingsItem = new AdvancedListItem(); versionSettingsItem.getStyleClass().add("navigation-drawer-item"); versionSettingsItem.setTitle(i18n("settings.game")); - versionSettingsItem.setLeftGraphic(wrap(SVG::gearOutline)); + versionSettingsItem.setLeftGraphic(wrap(SVG.GEAR_OUTLINE)); versionSettingsItem.setActionButtonVisible(false); versionSettingsItem.activeProperty().bind(control.tab.getSelectionModel().selectedItemProperty().isEqualTo(control.versionSettingsTab)); runInFX(() -> FXUtils.installFastTooltip(versionSettingsItem, i18n("settings.game"))); @@ -245,7 +245,7 @@ public class VersionPage extends DecoratorAnimatedPage implements DecoratorPage AdvancedListItem modListItem = new AdvancedListItem(); modListItem.getStyleClass().add("navigation-drawer-item"); modListItem.setTitle(i18n("mods.manage")); - modListItem.setLeftGraphic(wrap(SVG::puzzle)); + modListItem.setLeftGraphic(wrap(SVG.PUZZLE)); modListItem.setActionButtonVisible(false); modListItem.activeProperty().bind(control.tab.getSelectionModel().selectedItemProperty().isEqualTo(control.modListTab)); runInFX(() -> FXUtils.installFastTooltip(modListItem, i18n("mods.manage"))); @@ -254,7 +254,7 @@ public class VersionPage extends DecoratorAnimatedPage implements DecoratorPage AdvancedListItem installerListItem = new AdvancedListItem(); installerListItem.getStyleClass().add("navigation-drawer-item"); installerListItem.setTitle(i18n("settings.tabs.installers")); - installerListItem.setLeftGraphic(wrap(SVG::cube)); + installerListItem.setLeftGraphic(wrap(SVG.CUBE)); installerListItem.setActionButtonVisible(false); installerListItem.activeProperty().bind(control.tab.getSelectionModel().selectedItemProperty().isEqualTo(control.installerListTab)); runInFX(() -> FXUtils.installFastTooltip(installerListItem, i18n("settings.tabs.installers"))); @@ -263,7 +263,7 @@ public class VersionPage extends DecoratorAnimatedPage implements DecoratorPage AdvancedListItem worldListItem = new AdvancedListItem(); worldListItem.getStyleClass().add("navigation-drawer-item"); worldListItem.setTitle(i18n("world.manage")); - worldListItem.setLeftGraphic(wrap(SVG::earth)); + worldListItem.setLeftGraphic(wrap(SVG.EARTH)); worldListItem.setActionButtonVisible(false); worldListItem.activeProperty().bind(control.tab.getSelectionModel().selectedItemProperty().isEqualTo(control.worldListTab)); runInFX(() -> FXUtils.installFastTooltip(worldListItem, i18n("world.manage"))); @@ -279,53 +279,53 @@ public class VersionPage extends DecoratorAnimatedPage implements DecoratorPage PopupMenu browseList = new PopupMenu(); JFXPopup browsePopup = new JFXPopup(browseList); browseList.getContent().setAll( - new IconedMenuItem(FXUtils.limitingSize(SVG.gamepad(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.game"), FXUtils.withJFXPopupClosing(() -> control.onBrowse(""), browsePopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.puzzle(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.mod"), FXUtils.withJFXPopupClosing(() -> control.onBrowse("mods"), browsePopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.gearOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.config"), FXUtils.withJFXPopupClosing(() -> control.onBrowse("config"), browsePopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.texture(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.resourcepacks"), FXUtils.withJFXPopupClosing(() -> control.onBrowse("resourcepacks"), browsePopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.applicationOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.shaderpacks"), FXUtils.withJFXPopupClosing(() -> control.onBrowse("shaderpacks"), browsePopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.monitorScreenshot(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.screenshots"), FXUtils.withJFXPopupClosing(() -> control.onBrowse("screenshots"), browsePopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.earth(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.saves"), FXUtils.withJFXPopupClosing(() -> control.onBrowse("saves"), browsePopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.script(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("folder.logs"), FXUtils.withJFXPopupClosing(() -> control.onBrowse("logs"), browsePopup)) + new IconedMenuItem(SVG.GAMEPAD, i18n("folder.game"), () -> control.onBrowse(""), browsePopup), + new IconedMenuItem(SVG.PUZZLE, i18n("folder.mod"), () -> control.onBrowse("mods"), browsePopup), + new IconedMenuItem(SVG.GEAR_OUTLINE, i18n("folder.config"), () -> control.onBrowse("config"), browsePopup), + new IconedMenuItem(SVG.TEXTURE, i18n("folder.resourcepacks"), () -> control.onBrowse("resourcepacks"), browsePopup), + new IconedMenuItem(SVG.APPLICATION_OUTLINE, i18n("folder.shaderpacks"), () -> control.onBrowse("shaderpacks"), browsePopup), + new IconedMenuItem(SVG.MONITOR_SCREENSHOT, i18n("folder.screenshots"), () -> control.onBrowse("screenshots"), browsePopup), + new IconedMenuItem(SVG.EARTH, i18n("folder.saves"), () -> control.onBrowse("saves"), browsePopup), + new IconedMenuItem(SVG.SCRIPT, i18n("folder.logs"), () -> control.onBrowse("logs"), browsePopup) ); PopupMenu managementList = new PopupMenu(); JFXPopup managementPopup = new JFXPopup(managementList); managementList.getContent().setAll( - new IconedMenuItem(FXUtils.limitingSize(SVG.rocketLaunchOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.launch.test"), FXUtils.withJFXPopupClosing(control::testGame, managementPopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.script(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.launch_script"), FXUtils.withJFXPopupClosing(control::generateLaunchScript, managementPopup)), + new IconedMenuItem(SVG.ROCKET_LAUNCH_OUTLINE, i18n("version.launch.test"), control::testGame, managementPopup), + new IconedMenuItem(SVG.SCRIPT, i18n("version.launch_script"), control::generateLaunchScript, managementPopup), new MenuSeparator(), - new IconedMenuItem(FXUtils.limitingSize(SVG.pencil(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.manage.rename"), FXUtils.withJFXPopupClosing(control::rename, managementPopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.copy(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.manage.duplicate"), FXUtils.withJFXPopupClosing(control::duplicate, managementPopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.deleteOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("version.manage.remove"), FXUtils.withJFXPopupClosing(control::remove, managementPopup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.export(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("modpack.export"), FXUtils.withJFXPopupClosing(control::export, managementPopup)), + new IconedMenuItem(SVG.PENCIL, i18n("version.manage.rename"), control::rename, managementPopup), + new IconedMenuItem(SVG.COPY, i18n("version.manage.duplicate"), control::duplicate, managementPopup), + new IconedMenuItem(SVG.DELETE_OUTLINE, i18n("version.manage.remove"), control::remove, managementPopup), + new IconedMenuItem(SVG.EXPORT, i18n("modpack.export"), control::export, managementPopup), new MenuSeparator(), - new IconedMenuItem(null, i18n("version.manage.redownload_assets_index"), FXUtils.withJFXPopupClosing(control::redownloadAssetIndex, managementPopup)), - new IconedMenuItem(null, i18n("version.manage.remove_assets"), FXUtils.withJFXPopupClosing(control::clearAssets, managementPopup)), - new IconedMenuItem(null, i18n("version.manage.remove_libraries"), FXUtils.withJFXPopupClosing(control::clearLibraries, managementPopup)), - new IconedMenuItem(null, i18n("version.manage.clean"), FXUtils.withJFXPopupClosing(control::clearJunkFiles, managementPopup)).addTooltip(i18n("version.manage.clean.tooltip")) + new IconedMenuItem(null, i18n("version.manage.redownload_assets_index"), control::redownloadAssetIndex, managementPopup), + new IconedMenuItem(null, i18n("version.manage.remove_assets"), control::clearAssets, managementPopup), + new IconedMenuItem(null, i18n("version.manage.remove_libraries"), control::clearLibraries, managementPopup), + new IconedMenuItem(null, i18n("version.manage.clean"), control::clearJunkFiles, managementPopup).addTooltip(i18n("version.manage.clean.tooltip")) ); AdvancedListBox toolbar = new AdvancedListBox() .addNavigationDrawerItem(upgradeItem -> { upgradeItem.setTitle(i18n("version.update")); - upgradeItem.setLeftGraphic(wrap(SVG::update)); + upgradeItem.setLeftGraphic(wrap(SVG.UPDATE)); upgradeItem.visibleProperty().bind(control.currentVersionUpgradable); upgradeItem.setOnAction(e -> control.updateGame()); }) .addNavigationDrawerItem(testGameItem -> { testGameItem.setTitle(i18n("version.launch.test")); - testGameItem.setLeftGraphic(wrap(SVG::rocketLaunchOutline)); + testGameItem.setLeftGraphic(wrap(SVG.ROCKET_LAUNCH_OUTLINE)); testGameItem.setOnAction(e -> control.testGame()); }) .addNavigationDrawerItem(browseMenuItem -> { browseMenuItem.setTitle(i18n("settings.game.exploration")); - browseMenuItem.setLeftGraphic(wrap(SVG::folderOutline)); + browseMenuItem.setLeftGraphic(wrap(SVG.FOLDER_OUTLINE)); browseMenuItem.setOnAction(e -> browsePopup.show(browseMenuItem, JFXPopup.PopupVPosition.BOTTOM, JFXPopup.PopupHPosition.LEFT, browseMenuItem.getWidth(), 0)); }) .addNavigationDrawerItem(managementItem -> { managementItem.setTitle(i18n("settings.game.management")); - managementItem.setLeftGraphic(wrap(SVG::wrenchOutline)); + managementItem.setLeftGraphic(wrap(SVG.WRENCH_OUTLINE)); managementItem.setOnAction(e -> managementPopup.show(managementItem, JFXPopup.PopupVPosition.BOTTOM, JFXPopup.PopupHPosition.LEFT, managementItem.getWidth(), 0)); }); toolbar.getStyleClass().add("advanced-list-box-clear-padding"); @@ -354,8 +354,8 @@ public class VersionPage extends DecoratorAnimatedPage implements DecoratorPage return stackPane; } - public static Node wrap(SVG.SVGIcon svg) { - return wrap(svg.createIcon(null, 20, 20)); + public static Node wrap(SVG svg) { + return wrap(svg.createIcon((Paint) null, 20, 20)); } public interface VersionLoadable { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListItemSkin.java index 322cad69f..e83c7f962 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListItemSkin.java @@ -68,9 +68,9 @@ public class WorldListItemSkin extends SkinBase { JFXPopup popup = new JFXPopup(menu); menu.getContent().setAll( - new IconedMenuItem(FXUtils.limitingSize(SVG.gearOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("world.datapack"), FXUtils.withJFXPopupClosing(skinnable::manageDatapacks, popup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.export(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("world.export"), FXUtils.withJFXPopupClosing(skinnable::export, popup)), - new IconedMenuItem(FXUtils.limitingSize(SVG.folderOutline(Theme.blackFillBinding(), 14, 14), 14, 14), i18n("world.reveal"), FXUtils.withJFXPopupClosing(skinnable::reveal, popup))); + new IconedMenuItem(SVG.GEAR_OUTLINE, i18n("world.datapack"), skinnable::manageDatapacks, popup), + new IconedMenuItem(SVG.EXPORT, i18n("world.export"), skinnable::export, popup), + new IconedMenuItem(SVG.FOLDER_OUTLINE, i18n("world.reveal"), skinnable::reveal, popup)); HBox right = new HBox(); right.setAlignment(Pos.CENTER_RIGHT); @@ -81,7 +81,7 @@ public class WorldListItemSkin extends SkinBase { }); btnManage.getStyleClass().add("toggle-icon4"); BorderPane.setAlignment(btnManage, Pos.CENTER); - btnManage.setGraphic(SVG.dotsVertical(Theme.blackFillBinding(), -1, -1)); + btnManage.setGraphic(SVG.DOTS_VERTICAL.createIcon(Theme.blackFill(), -1, -1)); right.getChildren().add(btnManage); root.setRight(right); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java index 40b6acd33..af63060b2 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java @@ -169,9 +169,9 @@ public class WorldListPage extends ListPageBase implements Versio chkShowAll.selectedProperty().bindBidirectional(skinnable.showAllProperty()); return Arrays.asList(chkShowAll, - createToolbarButton2(i18n("button.refresh"), SVG::refresh, skinnable::refresh), - createToolbarButton2(i18n("world.add"), SVG::plus, skinnable::add), - createToolbarButton2(i18n("world.download"), SVG::plus, skinnable::download)); + createToolbarButton2(i18n("button.refresh"), SVG.REFRESH, skinnable::refresh), + createToolbarButton2(i18n("world.add"), SVG.PLUS, skinnable::add), + createToolbarButton2(i18n("world.download"), SVG.PLUS, skinnable::download)); } } }