Update logo

This commit is contained in:
crschnick 2023-06-21 13:14:19 +00:00
parent 319a1d2750
commit 1354e00dbd
30 changed files with 24 additions and 45 deletions

View file

@ -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;
}

View file

@ -372,7 +372,7 @@ public class AppLogs {
TrackEvent.builder()
.category(name)
.type(level.toString().toLowerCase())
.message(formatted)
.message(msg)
.build()
.handle();
}

View file

@ -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 -> {

View file

@ -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<Stage, Comp<?>> contentFunc, boolean bindSize, ObservableValue<Boolean> 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()));
}
}
}
}

View file

@ -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);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
dist/logo/ico/logo_128x128.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

BIN
dist/logo/ico/logo_16x16.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

BIN
dist/logo/ico/logo_24x24.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

BIN
dist/logo/ico/logo_256x256.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
dist/logo/ico/logo_32x32.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
dist/logo/ico/logo_48x48.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
dist/logo/logo.ico vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 74 KiB

BIN
dist/logo/logo.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 7 KiB