Bookmarks: better rendering for "check" gutter icon idea/138.632
authorVassiliy <vassiliy.kudryashov@jetbrains.com>
Mon, 16 Jun 2014 14:13:48 +0000 (18:13 +0400)
committerVassiliy <vassiliy.kudryashov@jetbrains.com>
Mon, 16 Jun 2014 14:14:46 +0000 (18:14 +0400)
platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColors.java
platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java

index fe3242e47b44712bc59c2a5546d0e3e8a58f9747..29cb27933d7cee2d36d590668a982f2e1c5ed7eb 100644 (file)
@@ -48,7 +48,7 @@ public interface EditorColors {
   TextAttributesKey FOLDED_TEXT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("FOLDED_TEXT_ATTRIBUTES");
   TextAttributesKey DELETED_TEXT_ATTRIBUTES = TextAttributesKey.createTextAttributesKey("DELETED_TEXT_ATTRIBUTES");
 
-  ColorKey GUTTER_BACKGROUND = ColorKey.createColorKey("GUTTER_BACKGROUND");
+  ColorKey GUTTER_BACKGROUND = ColorKey.createColorKey("GUTTER_BACKGROUND", new JBColor(0xf0f0f0, 0x313335));
   @Deprecated ColorKey LEFT_GUTTER_BACKGROUND = GUTTER_BACKGROUND;
   ColorKey NOTIFICATION_BACKGROUND = ColorKey.createColorKey("NOTIFICATION_BACKGROUND");
 
index e6cd53e811f83df93407764b0b65b5fd4ef564b6..d22e251ed4ca64262dee1c13ae73988ac8c4a426 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.navigation.NavigationItem;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.RangeMarker;
 import com.intellij.openapi.editor.colors.CodeInsightColors;
+import com.intellij.openapi.editor.colors.EditorColors;
 import com.intellij.openapi.editor.colors.EditorColorsManager;
 import com.intellij.openapi.editor.ex.MarkupModelEx;
 import com.intellij.openapi.editor.ex.RangeHighlighterEx;
@@ -335,11 +336,15 @@ public class Bookmark implements Navigatable {
 
     @Override
     public void paintIcon(Component c, Graphics g, int x, int y) {
-      g.setColor(ICON_BACKGROUND_COLOR);
-      g.fillRect(x, y, getIconWidth(), getIconHeight());
-      g.setColor(JBColor.GRAY);
-      g.drawRect(x, y, getIconWidth(), getIconHeight());
-      myIcon.paintIcon(c, g, x, y);
+      Graphics2D g2 = (Graphics2D)g.create();
+      try {
+        Color gutterBackground = EditorColors.GUTTER_BACKGROUND.getDefaultColor();
+        g2.setColor(gutterBackground);
+        g2.fillRoundRect(x, y, getIconWidth(), getIconHeight(), 4, 4);
+        myIcon.paintIcon(c, g2, x, y);
+      } finally {
+        g2.dispose();
+      }
     }
 
     @Override