Browse Source

Fixed wrongly printing a warning.

Adjusted demos for new theme system.
pull/127/head
weisj 5 years ago
parent
commit
2a80405bbc
  1. 2
      core/src/main/java/com/github/weisj/darklaf/theme/PropertyFontMapper.java
  2. 4
      core/src/test/java/ui/ComponentDemo.java
  3. 2
      core/src/test/java/ui/tabFrame/TabFrameDemo.java

2
core/src/main/java/com/github/weisj/darklaf/theme/PropertyFontMapper.java

@ -46,7 +46,7 @@ public class PropertyFontMapper implements FontMapper {
adjustment = getSize(defaults);
// No need to create a new font.
if (adjustment == 0) return font;
if (adjustment < font.getSize2D()) {
if (adjustment + font.getSize2D() <= 0) {
if (adjustment != Integer.MIN_VALUE) {
LOGGER.warning("Font " + font + " would be invisible after applying "
+ "an adjustment of " + adjustment + ". Aborting!");

4
core/src/test/java/ui/ComponentDemo.java

@ -33,7 +33,9 @@ import java.awt.event.ActionEvent;
public interface ComponentDemo {
static Theme getTheme() {
return new IntelliJTheme();
return LafManager.themeForPreferredStyle(new PreferredThemeStyle(ContrastRule.STANDARD,
StyleRule.LIGHT,
FontSizeRule.DEFAULT));
}
JComponent createComponent();

2
core/src/test/java/ui/tabFrame/TabFrameDemo.java

@ -48,7 +48,7 @@ public class TabFrameDemo implements ComponentDemo {
private static Component createTextArea() {
NumberedTextComponent numberPane = new NumberedTextComponent(new NonWrappingTextPane() {{
setText(StringUtil.repeat(DemoResources.LOREM_IPSUM, 10));
setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14));
setFont(new Font(Font.MONOSPACED, Font.PLAIN, getFont().getSize()));
}});
NumberingPane numbering = numberPane.getNumberingPane();
Icon icon = IconLoader.get().getIcon("navigation/arrowRight.svg");

Loading…
Cancel
Save