Some controls/nodes respect style sheet changing some not.
I have a toggle button in my scene to set/remove css styles.
cssToggle.addChangeListener(ToggleButton.SELECTED, new ChangeListener() {
@Override
public void handle(Bean bean, PropertyReference<?> property) {
if ( cssToggle.isSelected() ) {
scene.getStylesheets().add(style);
} else {
scene.getStylesheets().setAll("");
}
}
});
But I've some problems on resetting the style.
TextBox:
the input font is still the font from the previous styled font
Rectangle:
the background fill is from the previous styled -fx-fill
ToggleButton:
After removing the style sheet I've two focus borders
This one
.toggle-button:focused{
-fx-border-color: deepskyblue ;
-fx-border-insets: -4;
-fx-border-width: 2;
}
and the standard focus border.
I've added a compiled screenshot and the source.
I have a toggle button in my scene to set/remove css styles.
cssToggle.addChangeListener(ToggleButton.SELECTED, new ChangeListener() {
@Override
public void handle(Bean bean, PropertyReference<?> property) {
if ( cssToggle.isSelected() ) {
scene.getStylesheets().add(style);
} else {
scene.getStylesheets().setAll("");
}
}
});
But I've some problems on resetting the style.
TextBox:
the input font is still the font from the previous styled font
Rectangle:
the background fill is from the previous styled -fx-fill
ToggleButton:
After removing the style sheet I've two focus borders
This one
.toggle-button:focused{
-fx-border-color: deepskyblue ;
-fx-border-insets: -4;
-fx-border-width: 2;
}
and the standard focus border.
I've added a compiled screenshot and the source.
- duplicates
-
JDK-8110059 CSS: revisit the way style values are applied
-
- Closed
-