Kaynağa Gözat

fix css instead of defining style from within code

Sebastian Stenzel 3 yıl önce
ebeveyn
işleme
7a1b1292ae

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

@@ -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?

+ 0 - 2
src/main/java/org/cryptomator/ui/health/ResultListCellController.java

@@ -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)), //

+ 15 - 5
src/main/resources/css/dark_theme.css

@@ -127,23 +127,33 @@
 	-fx-fill: TEXT_FILL;
 }
 
-.glyph-icon-primary {
+.glyph-icon.glyph-icon-primary,
+.list-cell .glyph-icon.glyph-icon-primary,
+.list-cell:selected .glyph-icon.glyph-icon-primary {
 	-fx-fill: PRIMARY;
 }
 
-.glyph-icon-muted {
+.glyph-icon.glyph-icon-muted,
+.list-cell .glyph-icon.glyph-icon-muted,
+.list-cell:selected .glyph-icon.glyph-icon-muted {
 	-fx-fill: TEXT_FILL_MUTED;
 }
 
-.glyph-icon-white {
+.glyph-icon.glyph-icon-white,
+.list-cell .glyph-icon.glyph-icon-white,
+.list-cell:selected .glyph-icon.glyph-icon-white {
 	-fx-fill: white;
 }
 
-.glyph-icon-red {
+.glyph-icon.glyph-icon-red,
+.list-cell .glyph-icon.glyph-icon-red,
+.list-cell:selected .glyph-icon.glyph-icon-red {
 	-fx-fill: RED_5;
 }
 
-.glyph-icon-orange {
+.glyph-icon.glyph-icon-orange,
+.list-cell .glyph-icon.glyph-icon-orange,
+.list-cell:selected .glyph-icon.glyph-icon-orange {
 	-fx-fill: ORANGE_5;
 }
 

+ 15 - 5
src/main/resources/css/light_theme.css

@@ -127,23 +127,33 @@
 	-fx-fill: TEXT_FILL;
 }
 
-.glyph-icon-primary {
+.glyph-icon.glyph-icon-primary,
+.list-cell .glyph-icon.glyph-icon-primary,
+.list-cell:selected .glyph-icon.glyph-icon-primary {
 	-fx-fill: PRIMARY;
 }
 
-.glyph-icon-muted {
+.glyph-icon.glyph-icon-muted,
+.list-cell .glyph-icon.glyph-icon-muted,
+.list-cell:selected .glyph-icon.glyph-icon-muted {
 	-fx-fill: TEXT_FILL_MUTED;
 }
 
-.glyph-icon-white {
+.glyph-icon.glyph-icon-white,
+.list-cell .glyph-icon.glyph-icon-white,
+.list-cell:selected .glyph-icon.glyph-icon-white {
 	-fx-fill: white;
 }
 
-.glyph-icon-red {
+.glyph-icon.glyph-icon-red,
+.list-cell .glyph-icon.glyph-icon-red,
+.list-cell:selected .glyph-icon.glyph-icon-red {
 	-fx-fill: RED_5;
 }
 
-.glyph-icon-orange {
+.glyph-icon.glyph-icon-orange,
+.list-cell .glyph-icon.glyph-icon-orange,
+.list-cell:selected .glyph-icon.glyph-icon-orange {
 	-fx-fill: ORANGE_5;
 }