tidy up title bar

Change-Id: I781b3e7447e7b67d153ca0e87944b949e101bb86
diff --git a/res/drawable-hdpi/url_bg_active.9.png b/res/drawable-hdpi/url_bg_active.9.png
new file mode 100644
index 0000000..479acb1
--- /dev/null
+++ b/res/drawable-hdpi/url_bg_active.9.png
Binary files differ
diff --git a/res/drawable-hdpi/url_bg_default.9.png b/res/drawable-hdpi/url_bg_default.9.png
new file mode 100644
index 0000000..7db9db4
--- /dev/null
+++ b/res/drawable-hdpi/url_bg_default.9.png
Binary files differ
diff --git a/res/drawable/url_selector.xml b/res/drawable/url_selector.xml
new file mode 100644
index 0000000..d4febe6
--- /dev/null
+++ b/res/drawable/url_selector.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:state_focused="true"
+        android:drawable="@drawable/url_bg_active" />
+    <item
+        android:state_focused="false"
+        android:drawable="@drawable/url_bg_default" />
+</selector>
\ No newline at end of file
diff --git a/res/layout/title_bar.xml b/res/layout/title_bar.xml
index 6412bc0..161e277 100644
--- a/res/layout/title_bar.xml
+++ b/res/layout/title_bar.xml
@@ -53,9 +53,9 @@
                 android:layout_weight="1.0"
                 android:layout_height="match_parent"
                 android:layout_marginLeft="2dip"
-                android:paddingLeft="0dip"
-                android:paddingRight="0dip"
-                android:background="@null"
+                android:paddingLeft="4dip"
+                android:paddingRight="4dip"
+                android:background="@drawable/url_selector"
                 android:textAppearance="?android:attr/textAppearanceMedium"
                 android:hint="@string/search_hint"
                 android:singleLine="true"
@@ -75,8 +75,8 @@
         <com.android.browser.view.StopProgressView
             style="?android:attr/progressBarStyleLarge"
             android:id="@+id/stop"
-            android:layout_width="36dip"
-            android:layout_height="36dip"
+            android:layout_width="40dip"
+            android:layout_height="40dip"
             android:layout_gravity="center_vertical"
             android:visibility="gone" />
     </LinearLayout>
diff --git a/src/com/android/browser/view/StopProgressView.java b/src/com/android/browser/view/StopProgressView.java
index bdafdb0..64fa5d0 100644
--- a/src/com/android/browser/view/StopProgressView.java
+++ b/src/com/android/browser/view/StopProgressView.java
@@ -70,6 +70,13 @@
     }
 
     @Override
+    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+        super.onLayout(changed, left, top, right, bottom);
+        mWidth = (right - left) * 2 / 3;
+        mHeight = (bottom - top) * 2 / 3;
+    }
+
+    @Override
     protected void onDraw(Canvas canvas) {
         super.onDraw(canvas);
         if (mOverlayDrawable != null) {
@@ -86,10 +93,6 @@
 
     public void setImageDrawable(Drawable d) {
         mOverlayDrawable = d;
-        if (d != null) {
-            mWidth = d.getIntrinsicWidth();
-            mHeight = d.getIntrinsicHeight();
-        }
     }
 
 }