diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 4344e888..59050cb0 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -2186,6 +2186,14 @@ public class AppController implements Initializable { } else { tabs.getScene().getStylesheets().remove(darkCss); } + + for(Tab tab : tabs.getTabs()) { + if(tab.getUserData() instanceof WalletTabData) { + Label tabLabel = (Label)tab.getGraphic(); + WalletIcon walletIcon = (WalletIcon)tabLabel.getGraphic(); + walletIcon.refresh(); + } + } } @Subscribe diff --git a/src/main/java/com/sparrowwallet/sparrow/control/WalletIcon.java b/src/main/java/com/sparrowwallet/sparrow/control/WalletIcon.java index ca07cb94..28927007 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/WalletIcon.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/WalletIcon.java @@ -2,7 +2,9 @@ package com.sparrowwallet.sparrow.control; import com.sparrowwallet.drongo.wallet.*; import com.sparrowwallet.sparrow.AppServices; +import com.sparrowwallet.sparrow.Theme; import com.sparrowwallet.sparrow.glyphfont.FontAwesome5; +import com.sparrowwallet.sparrow.io.Config; import com.sparrowwallet.sparrow.io.ImageUtils; import com.sparrowwallet.sparrow.io.Storage; import javafx.application.Platform; @@ -60,18 +62,16 @@ public class WalletIcon extends StackPane { WalletModel walletModel = keystore.getWalletModel(); Image image = null; - try { - image = new Image("image/" + walletModel.getType() + "-icon.png", 15, 15, true, true); - } catch(Exception e) { - //ignore + if(Config.get().getTheme() == Theme.DARK) { + image = loadImage("image/" + walletModel.getType() + "-icon-invert.png"); } if(image == null) { - try { - image = new Image("image/" + walletModel.getType() + ".png", 15, 15, true, true); - } catch(Exception e) { - //ignore - } + image = loadImage("image/" + walletModel.getType() + "-icon.png"); + } + + if(image == null) { + image = loadImage("image/" + walletModel.getType() + ".png"); } if(image != null && !image.isError()) { @@ -88,6 +88,16 @@ public class WalletIcon extends StackPane { } } + private Image loadImage(String imageName) { + try { + return new Image(imageName, 15, 15, true, true); + } catch(Exception e) { + //ignore + } + + return null; + } + private void addWalletIcon(String walletId) { Image image = new Image(PROTOCOL + ":" + walletId + "?" + QUERY, WIDTH, HEIGHT, true, false); getChildren().clear(); diff --git a/src/main/resources/image/bitbox02-icon-invert.png b/src/main/resources/image/bitbox02-icon-invert.png new file mode 100644 index 00000000..59e6eb08 Binary files /dev/null and b/src/main/resources/image/bitbox02-icon-invert.png differ diff --git a/src/main/resources/image/bitbox02-icon-invert@2x.png b/src/main/resources/image/bitbox02-icon-invert@2x.png new file mode 100644 index 00000000..88e7d742 Binary files /dev/null and b/src/main/resources/image/bitbox02-icon-invert@2x.png differ diff --git a/src/main/resources/image/cobovault-icon-invert.png b/src/main/resources/image/cobovault-icon-invert.png new file mode 100644 index 00000000..e26f4cb9 Binary files /dev/null and b/src/main/resources/image/cobovault-icon-invert.png differ diff --git a/src/main/resources/image/cobovault-icon-invert@2x.png b/src/main/resources/image/cobovault-icon-invert@2x.png new file mode 100644 index 00000000..028d08f4 Binary files /dev/null and b/src/main/resources/image/cobovault-icon-invert@2x.png differ diff --git a/src/main/resources/image/cobovault-icon.png b/src/main/resources/image/cobovault-icon.png new file mode 100644 index 00000000..f3f8c3d4 Binary files /dev/null and b/src/main/resources/image/cobovault-icon.png differ diff --git a/src/main/resources/image/cobovault-icon@2x.png b/src/main/resources/image/cobovault-icon@2x.png new file mode 100644 index 00000000..cd23193c Binary files /dev/null and b/src/main/resources/image/cobovault-icon@2x.png differ diff --git a/src/main/resources/image/coldcard-icon-invert.png b/src/main/resources/image/coldcard-icon-invert.png new file mode 100644 index 00000000..de360357 Binary files /dev/null and b/src/main/resources/image/coldcard-icon-invert.png differ diff --git a/src/main/resources/image/coldcard-icon-invert@2x.png b/src/main/resources/image/coldcard-icon-invert@2x.png new file mode 100644 index 00000000..c6f01517 Binary files /dev/null and b/src/main/resources/image/coldcard-icon-invert@2x.png differ diff --git a/src/main/resources/image/jade-icon-invert.png b/src/main/resources/image/jade-icon-invert.png new file mode 100644 index 00000000..2acce870 Binary files /dev/null and b/src/main/resources/image/jade-icon-invert.png differ diff --git a/src/main/resources/image/jade-icon-invert@2x.png b/src/main/resources/image/jade-icon-invert@2x.png new file mode 100644 index 00000000..fc57ec02 Binary files /dev/null and b/src/main/resources/image/jade-icon-invert@2x.png differ diff --git a/src/main/resources/image/jade-icon.png b/src/main/resources/image/jade-icon.png new file mode 100644 index 00000000..8e1d00e3 Binary files /dev/null and b/src/main/resources/image/jade-icon.png differ diff --git a/src/main/resources/image/jade-icon@2x.png b/src/main/resources/image/jade-icon@2x.png new file mode 100644 index 00000000..840d8095 Binary files /dev/null and b/src/main/resources/image/jade-icon@2x.png differ diff --git a/src/main/resources/image/keystone-icon-invert.png b/src/main/resources/image/keystone-icon-invert.png new file mode 100644 index 00000000..9f107f1b Binary files /dev/null and b/src/main/resources/image/keystone-icon-invert.png differ diff --git a/src/main/resources/image/keystone-icon-invert@2x.png b/src/main/resources/image/keystone-icon-invert@2x.png new file mode 100644 index 00000000..11875e67 Binary files /dev/null and b/src/main/resources/image/keystone-icon-invert@2x.png differ diff --git a/src/main/resources/image/keystone-icon.png b/src/main/resources/image/keystone-icon.png new file mode 100644 index 00000000..a5113436 Binary files /dev/null and b/src/main/resources/image/keystone-icon.png differ diff --git a/src/main/resources/image/keystone-icon@2x.png b/src/main/resources/image/keystone-icon@2x.png new file mode 100644 index 00000000..4e1c9518 Binary files /dev/null and b/src/main/resources/image/keystone-icon@2x.png differ diff --git a/src/main/resources/image/ledger-icon-invert.png b/src/main/resources/image/ledger-icon-invert.png new file mode 100644 index 00000000..12432974 Binary files /dev/null and b/src/main/resources/image/ledger-icon-invert.png differ diff --git a/src/main/resources/image/ledger-icon-invert@2x.png b/src/main/resources/image/ledger-icon-invert@2x.png new file mode 100644 index 00000000..e2bab8cc Binary files /dev/null and b/src/main/resources/image/ledger-icon-invert@2x.png differ diff --git a/src/main/resources/image/passport-icon-invert.png b/src/main/resources/image/passport-icon-invert.png new file mode 100644 index 00000000..41cc9a75 Binary files /dev/null and b/src/main/resources/image/passport-icon-invert.png differ diff --git a/src/main/resources/image/passport-icon-invert@2x.png b/src/main/resources/image/passport-icon-invert@2x.png new file mode 100644 index 00000000..fe56fc63 Binary files /dev/null and b/src/main/resources/image/passport-icon-invert@2x.png differ diff --git a/src/main/resources/image/seedtool-icon-invert.png b/src/main/resources/image/seedtool-icon-invert.png new file mode 100644 index 00000000..c36d8799 Binary files /dev/null and b/src/main/resources/image/seedtool-icon-invert.png differ diff --git a/src/main/resources/image/seedtool-icon-invert@2x.png b/src/main/resources/image/seedtool-icon-invert@2x.png new file mode 100644 index 00000000..5ec2150c Binary files /dev/null and b/src/main/resources/image/seedtool-icon-invert@2x.png differ diff --git a/src/main/resources/image/seedtool-icon.png b/src/main/resources/image/seedtool-icon.png new file mode 100644 index 00000000..cb2203fc Binary files /dev/null and b/src/main/resources/image/seedtool-icon.png differ diff --git a/src/main/resources/image/seedtool-icon@2x.png b/src/main/resources/image/seedtool-icon@2x.png new file mode 100644 index 00000000..d98bfdd1 Binary files /dev/null and b/src/main/resources/image/seedtool-icon@2x.png differ diff --git a/src/main/resources/image/specter-icon-invert.png b/src/main/resources/image/specter-icon-invert.png new file mode 100644 index 00000000..0f872a0f Binary files /dev/null and b/src/main/resources/image/specter-icon-invert.png differ diff --git a/src/main/resources/image/specter-icon-invert@2x.png b/src/main/resources/image/specter-icon-invert@2x.png new file mode 100644 index 00000000..fce2f179 Binary files /dev/null and b/src/main/resources/image/specter-icon-invert@2x.png differ diff --git a/src/main/resources/image/specter-icon.png b/src/main/resources/image/specter-icon.png new file mode 100644 index 00000000..aa40b18a Binary files /dev/null and b/src/main/resources/image/specter-icon.png differ diff --git a/src/main/resources/image/specter-icon@2x.png b/src/main/resources/image/specter-icon@2x.png new file mode 100644 index 00000000..e653575c Binary files /dev/null and b/src/main/resources/image/specter-icon@2x.png differ diff --git a/src/main/resources/image/trezor-icon-invert.png b/src/main/resources/image/trezor-icon-invert.png new file mode 100644 index 00000000..89329283 Binary files /dev/null and b/src/main/resources/image/trezor-icon-invert.png differ diff --git a/src/main/resources/image/trezor-icon-invert@2x.png b/src/main/resources/image/trezor-icon-invert@2x.png new file mode 100644 index 00000000..84e785e6 Binary files /dev/null and b/src/main/resources/image/trezor-icon-invert@2x.png differ