use of javax.swing.plaf.synth.SynthStyleFactory in project intellij-community by JetBrains.
the class LafManagerImpl method fixGtkPopupStyle.
private static void fixGtkPopupStyle() {
if (!UIUtil.isUnderGTKLookAndFeel())
return;
final SynthStyleFactory original = SynthLookAndFeel.getStyleFactory();
SynthLookAndFeel.setStyleFactory(new SynthStyleFactory() {
@Override
public SynthStyle getStyle(final JComponent c, final Region id) {
final SynthStyle style = original.getStyle(c, id);
if (id == Region.POPUP_MENU) {
final Integer x = ReflectionUtil.getField(style.getClass(), style, int.class, "xThickness");
if (x != null && x == 0) {
// workaround for Sun bug #6636964
ReflectionUtil.setField(style.getClass(), style, int.class, "xThickness", 1);
ReflectionUtil.setField(style.getClass(), style, int.class, "yThickness", 3);
}
}
return style;
}
});
// invokes updateUI() -> updateStyle()
new JBPopupMenu();
SynthLookAndFeel.setStyleFactory(original);
}
use of javax.swing.plaf.synth.SynthStyleFactory in project jdk8u_jdk by JetBrains.
the class NimbusLookAndFeel method initialize.
/** Called by UIManager when this look and feel is installed. */
@Override
public void initialize() {
super.initialize();
defaults.initialize();
// create synth style factory
setStyleFactory(new SynthStyleFactory() {
@Override
public SynthStyle getStyle(JComponent c, Region r) {
return defaults.getStyle(c, r);
}
});
}
Aggregations