mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Disable engravement on windows and linux for now since it doesn't look great without proper particular antialiasing.
This commit is contained in:
@@ -19,11 +19,15 @@
|
||||
*/
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
|
||||
import java.awt.*;
|
||||
import java.text.AttributedCharacterIterator;
|
||||
|
||||
public class EngravedTextGraphics extends Graphics2DDelegate {
|
||||
private final static Color SHADOW_COLOR = new Color(250, 250, 250, 140);
|
||||
private final static boolean ALLOW_ENGRAVEMENT = SystemInfo.isMac;
|
||||
|
||||
public EngravedTextGraphics(Graphics2D g2d) {
|
||||
super(g2d);
|
||||
}
|
||||
@@ -35,55 +39,66 @@ public class EngravedTextGraphics extends Graphics2DDelegate {
|
||||
|
||||
@Override
|
||||
public void drawChars(char[] data, int offset, int length, int x, int y) {
|
||||
final Color color = getColor();
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawChars(data, offset, length, x, y + 1);
|
||||
if (ALLOW_ENGRAVEMENT) {
|
||||
final Color color = getColor();
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawChars(data, offset, length, x, y + 1);
|
||||
|
||||
setColor(color);
|
||||
}
|
||||
|
||||
setColor(color);
|
||||
super.drawChars(data, offset, length, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawString(String str, int x, int y) {
|
||||
final Color color = getColor();
|
||||
if (ALLOW_ENGRAVEMENT) {
|
||||
final Color color = getColor();
|
||||
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(str, x, y + 1);
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(str, x, y + 1);
|
||||
|
||||
setColor(color);
|
||||
setColor(color);
|
||||
}
|
||||
super.drawString(str, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawString(AttributedCharacterIterator iterator, float x, float y) {
|
||||
final Color color = getColor();
|
||||
if (ALLOW_ENGRAVEMENT) {
|
||||
final Color color = getColor();
|
||||
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(iterator, x, y + 1);
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(iterator, x, y + 1);
|
||||
|
||||
setColor(color);
|
||||
setColor(color);
|
||||
}
|
||||
super.drawString(iterator, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
|
||||
final Color color = getColor();
|
||||
if (ALLOW_ENGRAVEMENT) {
|
||||
final Color color = getColor();
|
||||
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(iterator, x, y + 1);
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(iterator, x, y + 1);
|
||||
|
||||
setColor(color);
|
||||
setColor(color);
|
||||
}
|
||||
super.drawString(iterator, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawString(String s, float x, float y) {
|
||||
final Color color = getColor();
|
||||
if (ALLOW_ENGRAVEMENT) {
|
||||
final Color color = getColor();
|
||||
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(s, x, y + 1);
|
||||
setColor(SHADOW_COLOR);
|
||||
super.drawString(s, x, y + 1);
|
||||
|
||||
setColor(color);
|
||||
setColor(color);
|
||||
}
|
||||
super.drawString(s, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user