Skip to content

Commit

Permalink
Force UserAgent as style origin. Fixes #121
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Dec 16, 2021
1 parent 8ed16d1 commit 702a0fe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.css.CssMetaData;
import javafx.css.StyleOrigin;
import javafx.css.Styleable;
import javafx.css.StyleableIntegerProperty;
import javafx.css.StyleableObjectProperty;
Expand Down Expand Up @@ -120,6 +121,11 @@ public Object getBean() {
public String getName() {
return "iconSize";
}

@Override
public StyleOrigin getStyleOrigin() {
return StyleOrigin.USER_AGENT;
}
};
iconSize.addListener((v, o, n) -> {
Font font = FontIcon.this.getFont();
Expand Down Expand Up @@ -150,6 +156,11 @@ public Object getBean() {
public String getName() {
return "iconColor";
}

@Override
public StyleOrigin getStyleOrigin() {
return StyleOrigin.USER_AGENT;
}
};
iconColor.addListener((v, o, n) -> FontIcon.this.setFill(n));
}
Expand All @@ -173,6 +184,11 @@ public Object getBean() {
public String getName() {
return "iconCode";
}

@Override
public StyleOrigin getStyleOrigin() {
return StyleOrigin.USER_AGENT;
}
};

iconCode.addListener((v, o, n) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import javafx.collections.ListChangeListener;
import javafx.collections.MapChangeListener;
import javafx.css.CssMetaData;
import javafx.css.StyleOrigin;
import javafx.css.Styleable;
import javafx.css.StyleableIntegerProperty;
import javafx.css.StyleableObjectProperty;
Expand Down Expand Up @@ -165,6 +166,11 @@ public Object getBean() {
public String getName() {
return "iconSize";
}

@Override
public StyleOrigin getStyleOrigin() {
return StyleOrigin.USER_AGENT;
}
};
iconSize.addListener(iconSizeChangeListener);
}
Expand All @@ -188,6 +194,11 @@ public Object getBean() {
public String getName() {
return "iconColor";
}

@Override
public StyleOrigin getStyleOrigin() {
return StyleOrigin.USER_AGENT;
}
};
iconColor.addListener(iconColorChangeListener);
}
Expand Down

0 comments on commit 702a0fe

Please sign in to comment.