While chasing down a problem where changes to the .scene -fx-font
was not resulting in a change in the font size of sliders with labeled
tick marks, I ran into a bit of code in StyleHelper.transitionToState that
does this:
// First we want to lookup the font associated with the Node in its
// current state so that all subsequent font-related sizes will be
// correct.
def keys:Key[] = node.impl_cssKeys();
var fontKey = DEFAULT_FONT_KEY;
for (key in keys) {
if (key.type == Type.FONT) {
fontKey = key;
break;
}
}
It appears to be trying to find the base font for the Node. Some controls,
however, define multiple keys of Type.FONT. Axis, for example does this:
public def impl_CSS_KEYS:Key[] = [
Node.impl_CSS_KEYS,
...
Key.FONT("-fx-label", Stylesheet.INHERIT),
...
Key.FONT("-fx-tick-label", Stylesheet.INHERIT),
...
];
As a result, the code in StyleHelper.transitionToState may not always be
doing what was intended.
I have no great thoughts on this one.
was not resulting in a change in the font size of sliders with labeled
tick marks, I ran into a bit of code in StyleHelper.transitionToState that
does this:
// First we want to lookup the font associated with the Node in its
// current state so that all subsequent font-related sizes will be
// correct.
def keys:Key[] = node.impl_cssKeys();
var fontKey = DEFAULT_FONT_KEY;
for (key in keys) {
if (key.type == Type.FONT) {
fontKey = key;
break;
}
}
It appears to be trying to find the base font for the Node. Some controls,
however, define multiple keys of Type.FONT. Axis, for example does this:
public def impl_CSS_KEYS:Key[] = [
Node.impl_CSS_KEYS,
...
Key.FONT("-fx-label", Stylesheet.INHERIT),
...
Key.FONT("-fx-tick-label", Stylesheet.INHERIT),
...
];
As a result, the code in StyleHelper.transitionToState may not always be
doing what was intended.
I have no great thoughts on this one.