mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 08:14:43 +00:00
add inverted icons for dark theme
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user