mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Enabling LCD rendering checkbox for Retina
This commit is contained in:
@@ -266,11 +266,10 @@ public class UISettings extends SimpleModificationTracker implements PersistentS
|
||||
UISettings uiSettings = getInstance();
|
||||
|
||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
|
||||
|
||||
if (!isRemoteDesktopConnected() && UIUtil.isRetina()) {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
}
|
||||
else {
|
||||
if (uiSettings == null || uiSettings.ANTIALIASING_IN_EDITOR) {
|
||||
} else {
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
//noinspection HardCodedStringLiteral
|
||||
Map map = (Map)tk.getDesktopProperty("awt.font.desktophints");
|
||||
@@ -283,17 +282,18 @@ public class UISettings extends SimpleModificationTracker implements PersistentS
|
||||
}
|
||||
}
|
||||
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, uiSettings.USE_LCD_RENDERING_IN_EDITOR ?
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB :
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
||||
|
||||
if (FORCE_USE_FRACTIONAL_METRICS) {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
|
||||
}
|
||||
}
|
||||
else {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (uiSettings != null && uiSettings.ANTIALIASING_IN_EDITOR) {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, uiSettings.USE_LCD_RENDERING_IN_EDITOR ?
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB :
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
||||
} else {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -407,8 +407,7 @@ public class UIUtil {
|
||||
//}
|
||||
|
||||
public static boolean isRetina() {
|
||||
return true;
|
||||
/*if (GraphicsEnvironment.isHeadless()) return false;
|
||||
if (GraphicsEnvironment.isHeadless()) return false;
|
||||
|
||||
//Temporary workaround for HiDPI on Windows/Linux
|
||||
if ("true".equalsIgnoreCase(System.getProperty("is.hidpi"))) {
|
||||
@@ -448,7 +447,7 @@ public class UIUtil {
|
||||
|
||||
return ourRetina.get();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasLeakingAppleListeners() {
|
||||
@@ -709,7 +708,7 @@ public class UIUtil {
|
||||
|
||||
private static final Map<Class, Ref<Method>> ourDefaultIconMethodsCache = new ConcurrentHashMap<Class, Ref<Method>>();
|
||||
public static int getCheckBoxTextHorizontalOffset(@NotNull JCheckBox cb) {
|
||||
// logic copied from javax.swing.plaf.basic.BasicRadioButtonUI.paint
|
||||
// logic copied from javax.swing.plaf.basic.BasicRadioButtonUI.paint
|
||||
ButtonUI ui = cb.getUI();
|
||||
String text = cb.getText();
|
||||
|
||||
@@ -1832,7 +1831,7 @@ public class UIUtil {
|
||||
@NotNull Graphics g,
|
||||
boolean useRetinaCondition,
|
||||
Consumer<Graphics2D> paintRoutine) {
|
||||
if (!useRetinaCondition || Registry.is("ide.mac.retina.disableDrawingFix")) {
|
||||
if (!useRetinaCondition || !isRetina() || Registry.is("ide.mac.retina.disableDrawingFix")) {
|
||||
paintRoutine.consume((Graphics2D)g);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user