mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +00:00
use smaller shared stage icon to reduce memory usage
This commit is contained in:
parent
cc31b5b78e
commit
9ec57b1ef6
3 changed files with 12 additions and 2 deletions
|
@ -92,6 +92,8 @@ public class AppServices {
|
|||
|
||||
private TrayManager trayManager;
|
||||
|
||||
private static Image windowIcon;
|
||||
|
||||
private static final BooleanProperty onlineProperty = new SimpleBooleanProperty(false);
|
||||
|
||||
private ExchangeSource.RatesService ratesService;
|
||||
|
@ -498,7 +500,7 @@ public class AppServices {
|
|||
stage.setMinWidth(650);
|
||||
stage.setMinHeight(708);
|
||||
stage.setScene(scene);
|
||||
stage.getIcons().add(new Image(MainApp.class.getResourceAsStream("/image/sparrow-large.png")));
|
||||
stage.getIcons().add(getWindowIcon());
|
||||
|
||||
appController.initializeView();
|
||||
stage.show();
|
||||
|
@ -509,6 +511,14 @@ public class AppServices {
|
|||
}
|
||||
}
|
||||
|
||||
private static Image getWindowIcon() {
|
||||
if(windowIcon == null) {
|
||||
windowIcon = new Image(MainApp.class.getResourceAsStream("/image/sparrow-icon.png"));
|
||||
}
|
||||
|
||||
return windowIcon;
|
||||
}
|
||||
|
||||
public static boolean isReducedWindowHeight(Node node) {
|
||||
return (node.getScene() != null && node.getScene().getWindow().getHeight() < 768);
|
||||
}
|
||||
|
@ -694,7 +704,7 @@ public class AppServices {
|
|||
|
||||
public static void setStageIcon(Window window) {
|
||||
Stage stage = (Stage)window;
|
||||
stage.getIcons().add(new Image(AppServices.class.getResourceAsStream("/image/sparrow-large.png")));
|
||||
stage.getIcons().add(getWindowIcon());
|
||||
|
||||
if(stage.getScene() != null && Config.get().getTheme() == Theme.DARK) {
|
||||
stage.getScene().getStylesheets().add(AppServices.class.getResource("darktheme.css").toExternalForm());
|
||||
|
|
BIN
src/main/resources/image/sparrow-icon.png
Normal file
BIN
src/main/resources/image/sparrow-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
BIN
src/main/resources/image/sparrow-icon@2x.png
Normal file
BIN
src/main/resources/image/sparrow-icon@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 102 KiB |
Loading…
Reference in a new issue