ソースを参照

set correct style class for all used check state icons

Armin Schrenk 3 年 前
コミット
6292ad059c

+ 3 - 1
src/main/java/org/cryptomator/ui/health/CheckStateIconView.java

@@ -14,6 +14,8 @@ import java.util.Optional;
 
 public class CheckStateIconView extends FontAwesome5IconView {
 
+	private final static List<FontAwesome5Icon> ATTENTION_ICONS = List.of(FontAwesome5Icon.CHECK, FontAwesome5Icon.EXCLAMATION_TRIANGLE, FontAwesome5Icon.TIMES);
+
 	private final ObjectProperty<Check> check = new SimpleObjectProperty<>();
 	private final OptionalBinding<Check.CheckState> state;
 	private final OptionalBinding<DiagnosticResult.Severity> severity;
@@ -26,7 +28,7 @@ public class CheckStateIconView extends FontAwesome5IconView {
 		this.severity = EasyBind.wrapNullable(check).mapObservable(Check::highestResultSeverityProperty);
 		glyphProperty().bind(EasyBind.combine(state, severity, this::glyphForState)); //TODO: does the binding need to be stored?
 		this.subscriptions = List.of(
-			EasyBind.includeWhen(getStyleClass(), "glyph-icon-muted", glyphProperty().isEqualTo(FontAwesome5Icon.INFO_CIRCLE)),
+			EasyBind.includeWhen(getStyleClass(), "glyph-icon-muted", EasyBind.map(glyphProperty(), glyph -> glyph == null || !ATTENTION_ICONS.contains(glyph))),
 			EasyBind.includeWhen(getStyleClass(), "glyph-icon-primary", glyphProperty().isEqualTo(FontAwesome5Icon.CHECK)),
 			EasyBind.includeWhen(getStyleClass(), "glyph-icon-orange", glyphProperty().isEqualTo(FontAwesome5Icon.EXCLAMATION_TRIANGLE)),
 			EasyBind.includeWhen(getStyleClass(), "glyph-icon-red", glyphProperty().isEqualTo(FontAwesome5Icon.TIMES))