diff options
-rw-r--r-- | res/values/colors.xml | 2 | ||||
-rw-r--r-- | res/values/dimensions.xml | 1 | ||||
-rw-r--r-- | src/com/android/browser/TabBar.java | 14 |
3 files changed, 15 insertions, 2 deletions
diff --git a/res/values/colors.xml b/res/values/colors.xml index 75b5acf..976b55b 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -35,5 +35,5 @@ <color name="bookmarkListFaviconBackground">#23ffffff</color> <color name="urlTextColor">#0E774A</color> <color name="tabFaviconBackground">#FF555555</color> - <color name="tabFocusHighlight">#FF00FAF0</color> + <color name="tabFocusHighlight">#FF99CC00</color> </resources> diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml index d0552a0..3badd17 100644 --- a/res/values/dimensions.xml +++ b/res/values/dimensions.xml @@ -20,6 +20,7 @@ <dimen name="tab_overlap">8dp</dimen> <dimen name="tab_addoverlap">14dp</dimen> <dimen name="tab_slice">15.5dp</dimen> + <dimen name="tab_focus_stroke">2dip</dimen> <dimen name="max_tab_width">300dp</dimen> <dimen name="bookmarkThumbnailWidth">90dip</dimen> <dimen name="bookmarkThumbnailHeight">80dip</dimen> diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java index 990d68f..4fb3ad4 100644 --- a/src/com/android/browser/TabBar.java +++ b/src/com/android/browser/TabBar.java @@ -133,6 +133,7 @@ public class TabBar extends LinearLayout mInactiveShaderPaint.setAntiAlias(true); mFocusPaint.setStyle(Paint.Style.STROKE); + mFocusPaint.setStrokeWidth(res.getDimension(R.dimen.tab_focus_stroke)); mFocusPaint.setAntiAlias(true); mFocusPaint.setColor(res.getColor(R.color.tabFocusHighlight)); } @@ -317,6 +318,7 @@ public class TabBar extends LinearLayout boolean mSelected; boolean mInLoad; Path mPath; + Path mFocusPath; int[] mWindowPos; /** @@ -326,6 +328,7 @@ public class TabBar extends LinearLayout super(context); setWillNotDraw(false); mPath = new Path(); + mFocusPath = new Path(); mWindowPos = new int[2]; mTab = tab; setGravity(Gravity.CENTER_VERTICAL); @@ -446,6 +449,7 @@ public class TabBar extends LinearLayout protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); setTabPath(mPath, 0, 0, r - l, b - t); + setFocusPath(mFocusPath, 0, 0, r - l, b - t); } @Override @@ -486,7 +490,7 @@ public class TabBar extends LinearLayout (mSelected ? mActiveShader : mInactiveShader).setLocalMatrix(matrix); canvas.drawPath(clipPath, paint); if (isFocused()) { - canvas.drawPath(clipPath, mFocusPaint); + canvas.drawPath(mFocusPath, mFocusPaint); } } @@ -499,6 +503,14 @@ public class TabBar extends LinearLayout path.close(); } + private void setFocusPath(Path path, int l, int t, int r, int b) { + path.reset(); + path.moveTo(l, b); + path.lineTo(l, t); + path.lineTo(r - mTabSliceWidth, t); + path.lineTo(r, b); + } + } static Drawable createFaviconBackground(Context context) { |