IDEA-184383 Large icons since 2017.3

This commit is contained in:
Anton Tarasov
2017-12-28 17:17:27 +03:00
parent 50daad2cf9
commit bc0f1656eb
2 changed files with 11 additions and 2 deletions
@@ -221,7 +221,7 @@ public class JBUI {
static {
setUserScaleFactor(UIUtil.isJreHiDPIEnabled() ? 1f : SYSTEM_SCALE_FACTOR);
LOG.info("System scale factor: " + SYSTEM_SCALE_FACTOR + " (" +
LOG.info("System scale factor: " + String.format("%.02f", SYSTEM_SCALE_FACTOR) + " (" +
(UIUtil.isJreHiDPIEnabled() ? "JRE-managed" : "IDE-managed") + " HiDPI)");
}
@@ -96,6 +96,15 @@ public class UIUtil {
// Applied to all JLabel instances, including subclasses. Supported in JBSDK only.
UIManager.getDefaults().put("javax.swing.JLabel.userStyleSheet", UIUtil.JBHtmlEditorKit.createStyleSheet());
if (SystemInfo.isLinux && Toolkit.getDefaultToolkit().getDesktopProperty("gnome.Xft/DPI") != null) {
float dpi_factor = 96 / (float)72; // J2D factor
int gnome_base_font_size = 11;
DEF_SYSTEM_FONT_SIZE = gnome_base_font_size * dpi_factor;
}
else {
DEF_SYSTEM_FONT_SIZE = 12;
}
}
public static void decorateFrame(@NotNull JRootPane pane) {
@@ -334,7 +343,7 @@ public class UIUtil {
private static volatile Pair<String, Integer> ourSystemFontData;
public static final float DEF_SYSTEM_FONT_SIZE = 12f; // TODO: consider 12 * 1.33 to compensate JDK's 72dpi font scale
public static final float DEF_SYSTEM_FONT_SIZE;
@NonNls private static final String ROOT_PANE = "JRootPane.future";