Browse Source

add inverted icons for dark theme

master
Craig Raw 2 years ago
parent
commit
a05fcba6d9
  1. 8
      src/main/java/com/sparrowwallet/sparrow/AppController.java
  2. 28
      src/main/java/com/sparrowwallet/sparrow/control/WalletIcon.java
  3. BIN
      src/main/resources/image/bitbox02-icon-invert.png
  4. BIN
      src/main/resources/image/bitbox02-icon-invert@2x.png
  5. BIN
      src/main/resources/image/cobovault-icon-invert.png
  6. BIN
      src/main/resources/image/cobovault-icon-invert@2x.png
  7. BIN
      src/main/resources/image/cobovault-icon.png
  8. BIN
      src/main/resources/image/cobovault-icon@2x.png
  9. BIN
      src/main/resources/image/coldcard-icon-invert.png
  10. BIN
      src/main/resources/image/coldcard-icon-invert@2x.png
  11. BIN
      src/main/resources/image/jade-icon-invert.png
  12. BIN
      src/main/resources/image/jade-icon-invert@2x.png
  13. BIN
      src/main/resources/image/jade-icon.png
  14. BIN
      src/main/resources/image/jade-icon@2x.png
  15. BIN
      src/main/resources/image/keystone-icon-invert.png
  16. BIN
      src/main/resources/image/keystone-icon-invert@2x.png
  17. BIN
      src/main/resources/image/keystone-icon.png
  18. BIN
      src/main/resources/image/keystone-icon@2x.png
  19. BIN
      src/main/resources/image/ledger-icon-invert.png
  20. BIN
      src/main/resources/image/ledger-icon-invert@2x.png
  21. BIN
      src/main/resources/image/passport-icon-invert.png
  22. BIN
      src/main/resources/image/passport-icon-invert@2x.png
  23. BIN
      src/main/resources/image/seedtool-icon-invert.png
  24. BIN
      src/main/resources/image/seedtool-icon-invert@2x.png
  25. BIN
      src/main/resources/image/seedtool-icon.png
  26. BIN
      src/main/resources/image/seedtool-icon@2x.png
  27. BIN
      src/main/resources/image/specter-icon-invert.png
  28. BIN
      src/main/resources/image/specter-icon-invert@2x.png
  29. BIN
      src/main/resources/image/specter-icon.png
  30. BIN
      src/main/resources/image/specter-icon@2x.png
  31. BIN
      src/main/resources/image/trezor-icon-invert.png
  32. BIN
      src/main/resources/image/trezor-icon-invert@2x.png

8
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

28
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();

BIN
src/main/resources/image/bitbox02-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/image/bitbox02-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/main/resources/image/cobovault-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/image/cobovault-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/main/resources/image/cobovault-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/image/cobovault-icon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/main/resources/image/coldcard-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/main/resources/image/coldcard-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/main/resources/image/jade-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/image/jade-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/main/resources/image/jade-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/image/jade-icon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/main/resources/image/keystone-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/main/resources/image/keystone-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/main/resources/image/keystone-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/main/resources/image/keystone-icon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/main/resources/image/ledger-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/image/ledger-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/main/resources/image/passport-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/main/resources/image/passport-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/main/resources/image/seedtool-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/main/resources/image/seedtool-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
src/main/resources/image/seedtool-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/main/resources/image/seedtool-icon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
src/main/resources/image/specter-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/main/resources/image/specter-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/main/resources/image/specter-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/main/resources/image/specter-icon@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/main/resources/image/trezor-icon-invert.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/image/trezor-icon-invert@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Loading…
Cancel
Save