diff --git a/app/src/main/java/io/xpipe/app/core/App.java b/app/src/main/java/io/xpipe/app/core/App.java index dfc05a2e4..4d92c1a3a 100644 --- a/app/src/main/java/io/xpipe/app/core/App.java +++ b/app/src/main/java/io/xpipe/app/core/App.java @@ -11,7 +11,6 @@ import io.xpipe.core.process.OsType; import javafx.application.Application; import javafx.application.Platform; import javafx.beans.binding.Bindings; -import javafx.scene.image.Image; import javafx.stage.Stage; import javax.imageio.ImageIO; @@ -21,7 +20,6 @@ public class App extends Application { private static App APP; private Stage stage; - private Image icon; public static App getApp() { return APP; @@ -33,13 +31,12 @@ public class App extends Application { APP = this; PlatformState.setCurrent(PlatformState.RUNNING); stage = primaryStage; - icon = AppImages.image("logo.png"); // Set dock icon explicitly on mac // This is necessary in case XPipe was started through a script as it will have no icon otherwise if (OsType.getLocal().equals(OsType.MACOS)) { try { - var iconUrl = Main.class.getResourceAsStream("resources/img/logo.png"); + var iconUrl = Main.class.getResourceAsStream("resources/img/logo/logo_128x128.png"); if (iconUrl != null) { var awtIcon = ImageIO.read(iconUrl); Taskbar.getTaskbar().setIconImage(awtIcon); @@ -49,8 +46,7 @@ public class App extends Application { } } - primaryStage.getIcons().clear(); - primaryStage.getIcons().add(icon); + AppWindowHelper.addIcons(stage); Platform.setImplicitExit(false); } @@ -104,10 +100,6 @@ public class App extends Application { }); } - public Image getIcon() { - return icon; - } - public Stage getStage() { return stage; } diff --git a/app/src/main/java/io/xpipe/app/core/AppLogs.java b/app/src/main/java/io/xpipe/app/core/AppLogs.java index 93e777d71..fd3bd887c 100644 --- a/app/src/main/java/io/xpipe/app/core/AppLogs.java +++ b/app/src/main/java/io/xpipe/app/core/AppLogs.java @@ -372,7 +372,7 @@ public class AppLogs { TrackEvent.builder() .category(name) .type(level.toString().toLowerCase()) - .message(formatted) + .message(msg) .build() .handle(); } diff --git a/app/src/main/java/io/xpipe/app/core/AppTray.java b/app/src/main/java/io/xpipe/app/core/AppTray.java index d489a9596..87a8756d4 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTray.java +++ b/app/src/main/java/io/xpipe/app/core/AppTray.java @@ -17,7 +17,7 @@ public class AppTray { private final ErrorHandler errorHandler; private AppTray() { - var url = AppResources.getResourceURL(AppResources.XPIPE_MODULE, "img/logo.png"); + var url = AppResources.getResourceURL(AppResources.XPIPE_MODULE, "img/logo/logo_48x48.png"); var builder = new FXTrayIcon.Builder(App.getApp().getStage(), url.orElse(null)) .menuItem(AppI18n.get("open"), e -> { diff --git a/app/src/main/java/io/xpipe/app/core/AppWindowHelper.java b/app/src/main/java/io/xpipe/app/core/AppWindowHelper.java index 60f9be3ad..046f8f6c6 100644 --- a/app/src/main/java/io/xpipe/app/core/AppWindowHelper.java +++ b/app/src/main/java/io/xpipe/app/core/AppWindowHelper.java @@ -12,7 +12,6 @@ import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; -import javafx.scene.image.Image; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.layout.Pane; @@ -21,6 +20,7 @@ import javafx.scene.layout.StackPane; import javafx.scene.text.Text; import javafx.stage.Stage; +import java.util.List; import java.util.Optional; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; @@ -39,21 +39,26 @@ public class AppWindowHelper { return sp; } + public static void addIcons(Stage stage) { + stage.getIcons().clear(); + for (String s : List.of( + "logo_16x16.png", + "logo_24x24.png", + "logo_32x32.png", + "logo_48x48.png", + "logo_128x128.png", + "logo_256x256.png")) { + if (AppImages.hasNormalImage("logo/" + s)) { + stage.getIcons().add(AppImages.image("logo/" + s)); + } + } + } + public static Stage sideWindow( String title, Function> contentFunc, boolean bindSize, ObservableValue loading) { var stage = new Stage(); - - if (App.getApp() != null) { - var icon = App.getApp().getIcon(); - stage.getIcons().add(icon); - } else { - var url = AppResources.getResourceURL(AppResources.XPIPE_MODULE, "img/logo.png"); - if (url.isPresent()) { - stage.getIcons().add(new Image(url.get().toString())); - } - } - stage.setTitle(title); + addIcons(stage); setupContent(stage, contentFunc, bindSize, loading); setupStylesheets(stage.getScene()); @@ -132,7 +137,7 @@ public class AppWindowHelper { public static Alert createEmptyAlert() { Alert alert = new Alert(Alert.AlertType.NONE); - setIcon(alert); + addIcons(((Stage) alert.getDialogPane().getScene().getWindow())); setupStylesheets(alert.getDialogPane().getScene()); return alert; } @@ -207,19 +212,4 @@ public class AppWindowHelper { stage.sizeToScene(); } - - private static void setIcon(Alert a) { - if (App.getApp() != null && App.getApp().getIcon() != null) { - ((Stage) a.getDialogPane().getScene().getWindow()) - .getIcons() - .add(App.getApp().getIcon()); - } else { - var url = AppResources.getResourceURL(AppResources.XPIPE_MODULE, "img/logo.png"); - if (url.isPresent()) { - ((Stage) a.getDialogPane().getScene().getWindow()) - .getIcons() - .add(new Image(url.get().toString())); - } - } - } } diff --git a/app/src/main/java/io/xpipe/app/prefs/PropertiesComp.java b/app/src/main/java/io/xpipe/app/prefs/PropertiesComp.java index 8244a2114..e98841dd9 100644 --- a/app/src/main/java/io/xpipe/app/prefs/PropertiesComp.java +++ b/app/src/main/java/io/xpipe/app/prefs/PropertiesComp.java @@ -1,10 +1,7 @@ package io.xpipe.app.prefs; import atlantafx.base.controls.Tile; -import io.xpipe.app.core.App; -import io.xpipe.app.core.AppFont; -import io.xpipe.app.core.AppI18n; -import io.xpipe.app.core.AppProperties; +import io.xpipe.app.core.*; import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.SimpleComp; import io.xpipe.app.fxcomps.impl.LabelComp; @@ -18,7 +15,7 @@ public class PropertiesComp extends SimpleComp { @Override protected Region createSimple() { var title = Comp.of(() -> { - var image = new ImageView(App.getApp().getIcon()); + var image = new ImageView(AppImages.image("logo/logo_48x48.png")); image.setPreserveRatio(true); image.setSmooth(true); image.setFitHeight(40); diff --git a/app/src/main/resources/io/xpipe/app/resources/img/logo.png b/app/src/main/resources/io/xpipe/app/resources/img/logo.png index 052a09355..0fbcf086b 100644 Binary files a/app/src/main/resources/io/xpipe/app/resources/img/logo.png and b/app/src/main/resources/io/xpipe/app/resources/img/logo.png differ diff --git a/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_128x128.png b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_128x128.png new file mode 100644 index 000000000..0fbcf086b Binary files /dev/null and b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_128x128.png differ diff --git a/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_16x16.png b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_16x16.png new file mode 100644 index 000000000..d05eb5223 Binary files /dev/null and b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_16x16.png differ diff --git a/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_24x24.png b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_24x24.png new file mode 100644 index 000000000..64b4ddb39 Binary files /dev/null and b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_24x24.png differ diff --git a/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_256x256.png b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_256x256.png new file mode 100644 index 000000000..67ff78ad5 Binary files /dev/null and b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_256x256.png differ diff --git a/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_32x32.png b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_32x32.png new file mode 100644 index 000000000..832763c47 Binary files /dev/null and b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_32x32.png differ diff --git a/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_48x48.png b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_48x48.png new file mode 100644 index 000000000..08841c929 Binary files /dev/null and b/app/src/main/resources/io/xpipe/app/resources/img/logo/logo_48x48.png differ diff --git a/dist/logo/ico/logo_128x128.png b/dist/logo/ico/logo_128x128.png new file mode 100644 index 000000000..0fbcf086b Binary files /dev/null and b/dist/logo/ico/logo_128x128.png differ diff --git a/dist/logo/ico/logo_16x16.png b/dist/logo/ico/logo_16x16.png new file mode 100644 index 000000000..d05eb5223 Binary files /dev/null and b/dist/logo/ico/logo_16x16.png differ diff --git a/dist/logo/ico/logo_24x24.png b/dist/logo/ico/logo_24x24.png new file mode 100644 index 000000000..64b4ddb39 Binary files /dev/null and b/dist/logo/ico/logo_24x24.png differ diff --git a/dist/logo/ico/logo_256x256.png b/dist/logo/ico/logo_256x256.png new file mode 100644 index 000000000..67ff78ad5 Binary files /dev/null and b/dist/logo/ico/logo_256x256.png differ diff --git a/dist/logo/ico/logo_32x32.png b/dist/logo/ico/logo_32x32.png new file mode 100644 index 000000000..832763c47 Binary files /dev/null and b/dist/logo/ico/logo_32x32.png differ diff --git a/dist/logo/ico/logo_48x48.png b/dist/logo/ico/logo_48x48.png new file mode 100644 index 000000000..08841c929 Binary files /dev/null and b/dist/logo/ico/logo_48x48.png differ diff --git a/dist/logo/logo.ico b/dist/logo/logo.ico index b113b8aa8..b0429b73e 100644 Binary files a/dist/logo/logo.ico and b/dist/logo/logo.ico differ diff --git a/dist/logo/logo.iconset/icon_128x128.png b/dist/logo/logo.iconset/icon_128x128.png index 849a0db9e..0fbcf086b 100644 Binary files a/dist/logo/logo.iconset/icon_128x128.png and b/dist/logo/logo.iconset/icon_128x128.png differ diff --git a/dist/logo/logo.iconset/icon_128x128@2.png b/dist/logo/logo.iconset/icon_128x128@2.png index 05d83d167..67ff78ad5 100644 Binary files a/dist/logo/logo.iconset/icon_128x128@2.png and b/dist/logo/logo.iconset/icon_128x128@2.png differ diff --git a/dist/logo/logo.iconset/icon_16x16.png b/dist/logo/logo.iconset/icon_16x16.png index e3c6825f8..d05eb5223 100644 Binary files a/dist/logo/logo.iconset/icon_16x16.png and b/dist/logo/logo.iconset/icon_16x16.png differ diff --git a/dist/logo/logo.iconset/icon_16x16@2.png b/dist/logo/logo.iconset/icon_16x16@2.png index 3268db333..832763c47 100644 Binary files a/dist/logo/logo.iconset/icon_16x16@2.png and b/dist/logo/logo.iconset/icon_16x16@2.png differ diff --git a/dist/logo/logo.iconset/icon_256x256.png b/dist/logo/logo.iconset/icon_256x256.png index 05d83d167..67ff78ad5 100644 Binary files a/dist/logo/logo.iconset/icon_256x256.png and b/dist/logo/logo.iconset/icon_256x256.png differ diff --git a/dist/logo/logo.iconset/icon_256x256@2.png b/dist/logo/logo.iconset/icon_256x256@2.png index 52b92ba85..350f87fff 100644 Binary files a/dist/logo/logo.iconset/icon_256x256@2.png and b/dist/logo/logo.iconset/icon_256x256@2.png differ diff --git a/dist/logo/logo.iconset/icon_32x32.png b/dist/logo/logo.iconset/icon_32x32.png index 3268db333..832763c47 100644 Binary files a/dist/logo/logo.iconset/icon_32x32.png and b/dist/logo/logo.iconset/icon_32x32.png differ diff --git a/dist/logo/logo.iconset/icon_32x32@2.png b/dist/logo/logo.iconset/icon_32x32@2.png index 32fc480e1..c11dbe7b0 100644 Binary files a/dist/logo/logo.iconset/icon_32x32@2.png and b/dist/logo/logo.iconset/icon_32x32@2.png differ diff --git a/dist/logo/logo.iconset/icon_512x512.png b/dist/logo/logo.iconset/icon_512x512.png index 52b92ba85..350f87fff 100644 Binary files a/dist/logo/logo.iconset/icon_512x512.png and b/dist/logo/logo.iconset/icon_512x512.png differ diff --git a/dist/logo/logo.iconset/icon_512x512@2.png b/dist/logo/logo.iconset/icon_512x512@2.png index 1b6693f2e..4095e850b 100644 Binary files a/dist/logo/logo.iconset/icon_512x512@2.png and b/dist/logo/logo.iconset/icon_512x512@2.png differ diff --git a/dist/logo/logo.png b/dist/logo/logo.png index 052a09355..0fbcf086b 100644 Binary files a/dist/logo/logo.png and b/dist/logo/logo.png differ