fix css instead of defining style from within code

This commit is contained in:
Sebastian Stenzel
2021-07-21 09:57:56 +02:00
parent 4a8dbfbc15
commit 7a1b1292ae
4 changed files with 30 additions and 13 deletions

View File

@@ -23,7 +23,6 @@ public class CheckStateIconView extends FontAwesome5IconView {
public CheckStateIconView() {
super();
this.getStyleClass().remove("glyph-icon");
this.state = EasyBind.wrapNullable(check).mapObservable(Check::stateProperty);
this.severity = EasyBind.wrapNullable(check).mapObservable(Check::highestResultSeverityProperty);
glyphProperty().bind(EasyBind.combine(state, severity, this::glyphForState)); //TODO: does the binding need to be stored?

View File

@@ -76,8 +76,6 @@ public class ResultListCellController implements FxController {
@FXML
public void initialize() {
// see getGlyph() for relevant glyphs:
severityView.getStyleClass().remove("glyph-icon");
fixView.getStyleClass().remove("glyph-icon");
subscriptions.addAll(List.of(EasyBind.includeWhen(severityView.getStyleClass(), "glyph-icon-muted", severityView.glyphProperty().isEqualTo(INFO_ICON)), //
EasyBind.includeWhen(severityView.getStyleClass(), "glyph-icon-primary", severityView.glyphProperty().isEqualTo(GOOD_ICON)), //
EasyBind.includeWhen(severityView.getStyleClass(), "glyph-icon-orange", severityView.glyphProperty().isEqualTo(WARN_ICON)), //