Skip to content

Commit 56c2a56

Browse files
committed
Feat: Add colors for addon channel icons in DownloadPage
1 parent a34a743 commit 56c2a56

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.jackhuang.hmcl.ui.Controllers;
4343
import org.jackhuang.hmcl.ui.FXUtils;
4444
import org.jackhuang.hmcl.ui.SVG;
45+
import org.jackhuang.hmcl.ui.SVGContainer;
4546
import org.jackhuang.hmcl.ui.construct.*;
4647
import org.jackhuang.hmcl.ui.decorator.DecoratorPage;
4748
import org.jackhuang.hmcl.util.*;
@@ -440,15 +441,21 @@ private static final class AddonItem extends StackPane {
440441
switch (dataItem.versionType()) {
441442
case Alpha:
442443
content.addTag(i18n("addon.channel.alpha"));
443-
graphicPane.getChildren().setAll(SVG.ALPHA_CIRCLE.createIcon(24));
444+
SVGContainer alphaIcon = SVG.ALPHA_CIRCLE.createIcon(24);
445+
alphaIcon.lookup(".svg").setStyle("-fx-fill: #ff496e;");
446+
graphicPane.getChildren().setAll(alphaIcon);
444447
break;
445448
case Beta:
446449
content.addTag(i18n("addon.channel.beta"));
447-
graphicPane.getChildren().setAll(SVG.BETA_CIRCLE.createIcon(24));
450+
SVGContainer betaIcon = SVG.BETA_CIRCLE.createIcon(24);
451+
betaIcon.lookup(".svg").setStyle("-fx-fill: #ffa347;");
452+
graphicPane.getChildren().setAll(betaIcon);
448453
break;
449454
case Release:
450455
content.addTag(i18n("addon.channel.release"));
451-
graphicPane.getChildren().setAll(SVG.RELEASE_CIRCLE.createIcon(24));
456+
SVGContainer releaseIcon = SVG.RELEASE_CIRCLE.createIcon(24);
457+
releaseIcon.lookup(".svg").setStyle("-fx-fill: #1bd96a;");
458+
graphicPane.getChildren().setAll(releaseIcon);
452459
break;
453460
}
454461

0 commit comments

Comments
 (0)