Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.jackhuang.hmcl.ui.Controllers;
import org.jackhuang.hmcl.ui.FXUtils;
import org.jackhuang.hmcl.ui.SVG;
import org.jackhuang.hmcl.ui.SVGContainer;
import org.jackhuang.hmcl.ui.construct.*;
import org.jackhuang.hmcl.ui.decorator.DecoratorPage;
import org.jackhuang.hmcl.util.*;
Expand Down Expand Up @@ -436,19 +437,34 @@ private static final class AddonItem extends StackPane {
content.setTitle(dataItem.name());
content.setSubtitle(I18n.formatDateTime(dataItem.datePublished()));

switch (dataItem.versionType()) {
case Alpha:
content.addTag(i18n("addon.channel.alpha"));
graphicPane.getChildren().setAll(SVG.ALPHA_CIRCLE.createIcon(24));
break;
case Beta:
content.addTag(i18n("addon.channel.beta"));
graphicPane.getChildren().setAll(SVG.BETA_CIRCLE.createIcon(24));
break;
case Release:
content.addTag(i18n("addon.channel.release"));
graphicPane.getChildren().setAll(SVG.RELEASE_CIRCLE.createIcon(24));
break;
@Nullable SVG svg = null;
@Nullable String styleClass = null;
if (dataItem.versionType() != null) {
switch (dataItem.versionType()) {
case Alpha:
content.addTag(i18n("addon.channel.alpha"));
svg = SVG.ALPHA_CIRCLE;
styleClass = "alpha";
break;
case Beta:
content.addTag(i18n("addon.channel.beta"));
svg = SVG.BETA_CIRCLE;
styleClass = "beta";
break;
case Release:
content.addTag(i18n("addon.channel.release"));
svg = SVG.RELEASE_CIRCLE;
styleClass = "release";
break;
default:
styleClass = "";
break;
}
}
Comment thread
KSSJW marked this conversation as resolved.
if (svg != null) {
SVGContainer icon = svg.createIcon(24);
icon.getStyleClass().addAll("addon-channel-icon", styleClass);
graphicPane.getChildren().setAll(icon);
}

for (ModLoaderType modLoaderType : dataItem.loaders()) {
Expand Down
12 changes: 12 additions & 0 deletions HMCL/src/main/resources/assets/css/brightness-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@
-fixed-log-fatal-background: #842029;
-fixed-log-selected: #3e3e3e;
}

.addon-channel-icon.alpha .svg {
-fx-fill: #ff496e;
}

.addon-channel-icon.beta .svg {
-fx-fill: #ffa347;
}

.addon-channel-icon.release .svg {
-fx-fill: #1bd96a;
}
12 changes: 12 additions & 0 deletions HMCL/src/main/resources/assets/css/brightness-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@
-fixed-log-fatal-background: #F7A699;
-fixed-log-selected: #f2f2f2;
}

.addon-channel-icon.alpha .svg {
-fx-fill: #cb2245;
}

.addon-channel-icon.beta .svg {
-fx-fill: #e08325;
}

.addon-channel-icon.release .svg {
-fx-fill: #00af5c;
}