@@ -350,11 +350,10 @@ protected void updateItem(CurrencyListItem item, boolean empty) {
350
350
default :
351
351
352
352
// use icon if available
353
- ImageView currencyIcon = getCurrencyIcon (code );
353
+ StackPane currencyIcon = getCurrencyIcon (code );
354
354
if (currencyIcon != null ) {
355
355
label1 .setText ("" );
356
- StackPane iconWrapper = new StackPane (currencyIcon ); // TODO: icon must be wrapped in StackPane for reliable rendering on linux
357
- label1 .setGraphic (iconWrapper );
356
+ label1 .setGraphic (currencyIcon );
358
357
}
359
358
360
359
if (preferences .isSortMarketCurrenciesNumerically () && item .numTrades > 0 ) {
@@ -461,11 +460,10 @@ protected void updateItem(TradeCurrency item, boolean empty) {
461
460
default :
462
461
463
462
// use icon if available
464
- ImageView currencyIcon = getCurrencyIcon (code );
463
+ StackPane currencyIcon = getCurrencyIcon (code );
465
464
if (currencyIcon != null ) {
466
465
label1 .setText ("" );
467
- StackPane iconWrapper = new StackPane (currencyIcon ); // TODO: icon must be wrapped in StackPane for reliable rendering on linux
468
- label1 .setGraphic (iconWrapper );
466
+ label1 .setGraphic (currencyIcon );
469
467
}
470
468
471
469
boolean isCrypto = CurrencyUtil .isCryptoCurrency (code );
@@ -506,11 +504,10 @@ protected void updateItem(TradeCurrency item, boolean empty) {
506
504
label2 .getStyleClass ().add ("currency-label" );
507
505
508
506
// use icon if available
509
- ImageView currencyIcon = getCurrencyIcon (item .getCode ());
507
+ StackPane currencyIcon = getCurrencyIcon (item .getCode ());
510
508
if (currencyIcon != null ) {
511
509
label1 .setText ("" );
512
- StackPane iconWrapper = new StackPane (currencyIcon ); // TODO: icon must be wrapped in StackPane for reliable rendering on linux
513
- label1 .setGraphic (iconWrapper );
510
+ label1 .setGraphic (currencyIcon );
514
511
}
515
512
516
513
box .getChildren ().addAll (label1 , label2 );
@@ -1283,11 +1280,11 @@ private static <T> void updateEdgeColumnStyleClasses(TableView<T> tableView) {
1283
1280
return contentColumns ;
1284
1281
}
1285
1282
1286
- public static ImageView getCurrencyIcon (String currencyCode ) {
1287
- return getCurrencyIcon (currencyCode , 24 );
1283
+ private static ImageView getCurrencyImageView (String currencyCode ) {
1284
+ return getCurrencyImageView (currencyCode , 24 );
1288
1285
}
1289
1286
1290
- public static ImageView getCurrencyIcon (String currencyCode , double size ) {
1287
+ private static ImageView getCurrencyImageView (String currencyCode , double size ) {
1291
1288
if (currencyCode == null ) return null ;
1292
1289
String imageId = getImageId (currencyCode );
1293
1290
if (imageId == null ) return null ;
@@ -1300,19 +1297,24 @@ public static ImageView getCurrencyIcon(String currencyCode, double size) {
1300
1297
return iconView ;
1301
1298
}
1302
1299
1300
+ public static StackPane getCurrencyIcon (String currencyCode ) {
1301
+ return new StackPane (getCurrencyImageView (currencyCode ));
1302
+ }
1303
+
1304
+ public static StackPane getCurrencyIcon (String currencyCode , double size ) {
1305
+ return new StackPane (getCurrencyImageView (currencyCode , size ));
1306
+ }
1307
+
1303
1308
public static StackPane getCurrencyIconWithBorder (String currencyCode ) {
1304
1309
return getCurrencyIconWithBorder (currencyCode , 25 , 1 );
1305
1310
}
1306
1311
1307
1312
public static StackPane getCurrencyIconWithBorder (String currencyCode , double size , double borderWidth ) {
1308
1313
if (currencyCode == null ) return null ;
1309
1314
1310
- ImageView icon = getCurrencyIcon (currencyCode , size );
1315
+ ImageView icon = getCurrencyImageView (currencyCode , size );
1311
1316
icon .setFitWidth (size - 2 * borderWidth );
1312
1317
icon .setFitHeight (size - 2 * borderWidth );
1313
- icon .setPreserveRatio (true );
1314
- icon .setSmooth (true );
1315
- icon .setCache (true );
1316
1318
1317
1319
StackPane circleWrapper = new StackPane (icon );
1318
1320
circleWrapper .setPrefSize (size , size );
0 commit comments