OSDN Git Service

GLE2: display selection a bit better.
authorRaphael Moll <ralf@android.com>
Fri, 10 Sep 2010 06:41:18 +0000 (23:41 -0700)
committerRaphael Moll <ralf@android.com>
Fri, 10 Sep 2010 06:43:46 +0000 (23:43 -0700)
Change-Id: Ifb1297299697712273694b239a07cf0812e20e7b

eclipse/plugins/com.android.ide.eclipse.adt/gscripts/BaseView.groovy
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/editors/layout/gscripts/IGraphics.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java

index 1ddf717..aff2e18 100755 (executable)
@@ -315,6 +315,12 @@ public class BaseView implements IViewRule {
 
         gc.setLineWidth(1);
         gc.setLineStyle(IGraphics.LineStyle.LINE_SOLID);
+        def olgBg = gc.getBackground();
+        gc.setBackground(gc.getForeground());
+        gc.setAlpha(64);
+        gc.fillRect(r);
+        gc.setBackground(olgBg);
+        gc.setAlpha(255);
         gc.drawRect(r);
 
         if (displayName == null || isMultipleSelection) {
index b6a7197..22a3a6d 100755 (executable)
@@ -43,6 +43,18 @@ public interface IGraphics {
     int getFontHeight();
 
     /**
+     * Returns the current foreground color.
+     * The foreground color is used for drawing operations including when text is drawn.
+     */
+    IColor getForeground();
+
+    /**
+     * Returns the current background color.
+     * The background color is used for fill operations.
+     */
+    IColor getBackground();
+
+    /**
      * Sets the foreground color. The foreground color is used
      * for drawing operations including when text is drawn.
      */
index 39e24d1..3648639 100755 (executable)
@@ -126,6 +126,16 @@ public class GCWrapper implements IGraphics {
         return mFontHeight;
     }
 
+    public IColor getForeground() {
+        Color c = getGc().getForeground();
+        return new ColorWrapper(c);
+    }
+
+    public IColor getBackground() {
+        Color c = getGc().getBackground();
+        return new ColorWrapper(c);
+    }
+
     public void setForeground(IColor color) {
         checkGC();
         getGc().setForeground(((ColorWrapper) color).getColor());