Bug 817749: No squishy button in tabs toolbar. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Wed, 19 Dec 2012 12:27:42 -0800
changeset 125827 53952a6be9cfa10f4c9a68604d6ea353dbb5e9a0
parent 125826 7998f3adb4c5ba142c65e0759b7779b9ed05c3de
child 125828 0f837335244588ce9b678c18d617e5354a68054d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs817749
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 817749: No squishy button in tabs toolbar. [r=mfinkle]
mobile/android/base/GeckoViewsFactory.java
mobile/android/base/Makefile.in
mobile/android/base/TabsPanel.java
mobile/android/base/TabsPanelButton.java
mobile/android/base/resources/drawable/tab_new_button.xml
mobile/android/base/resources/layout-land-v14/tabs_panel_toolbar_menu.xml
mobile/android/base/resources/layout-large-v11/tabs_panel_toolbar_menu.xml
mobile/android/base/resources/layout-xlarge-v11/tabs_panel_toolbar_menu.xml
mobile/android/base/resources/layout/tabs_panel_toolbar_menu.xml
mobile/android/base/resources/values-land-v14/dimens.xml
mobile/android/base/resources/values-large-v11/dimens.xml
mobile/android/base/resources/values/dimens.xml
--- a/mobile/android/base/GeckoViewsFactory.java
+++ b/mobile/android/base/GeckoViewsFactory.java
@@ -79,18 +79,16 @@ public final class GeckoViewsFactory imp
             else if (TextUtils.equals(viewName, "MenuButton"))
                 return new MenuButton(context, attrs);
             else if (TextUtils.equals(viewName, "RemoteTabs"))
                 return new RemoteTabs(context, attrs);
             else if (TextUtils.equals(viewName, "TabsButton"))
                 return new TabsButton(context, attrs);
             else if (TextUtils.equals(viewName, "TabsPanel"))
                 return new TabsPanel(context, attrs);
-            else if (TextUtils.equals(viewName, "TabsPanelButton"))
-                return new TabsPanelButton(context, attrs);
             else if (TextUtils.equals(viewName, "TabsTray"))
                 return new TabsTray(context, attrs);
             else if (TextUtils.equals(viewName, "TextSelectionHandle"))
                 return new TextSelectionHandle(context, attrs);
             else if (TextUtils.equals(viewName, "gfx.LayerView"))
                 return new LayerView(context, attrs);
             else if (TextUtils.equals(viewName, "Button"))
                 return new GeckoButton(context, attrs);
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -129,17 +129,16 @@ FENNEC_JAVA_FILES = \
   ShapedButton.java \
   SiteIdentityPopup.java \
   SuggestClient.java \
   SurfaceBits.java \
   Tab.java \
   Tabs.java \
   TabsButton.java \
   TabsPanel.java \
-  TabsPanelButton.java \
   TabsTray.java \
   TabsAccessor.java \
   TailTouchDelegate.java \
   Telemetry.java \
   TextSelection.java \
   TextSelectionHandle.java \
   ThumbnailHelper.java \
   WebAppAllocator.java \
@@ -416,25 +415,20 @@ RES_LAYOUT = \
   res/layout/abouthome_addon_row.xml \
   res/layout/abouthome_last_tabs_row.xml \
   res/layout/abouthome_promo_box.xml \
   res/layout/abouthome_section.xml \
   res/layout/abouthome_remote_tab_row.xml \
   res/layout/abouthome_topsite_item.xml \
   res/layout/validation_message.xml \
   $(NULL)
- 
-RES_LAYOUT_LAND_V14 = \
-  res/layout-land-v14/tabs_panel_toolbar_menu.xml \
-  $(NULL)
 
 RES_LAYOUT_LARGE_V11 = \
   res/layout-large-v11/doorhangerpopup.xml \
   res/layout-large-v11/site_identity_popup.xml \
-  res/layout-large-v11/tabs_panel_toolbar_menu.xml \
   $(NULL)
 
 RES_LAYOUT_XLARGE_V11 = \
   res/layout-xlarge-v11/font_size_preference.xml \
   res/layout-xlarge-v11/remote_tabs_child.xml \
   res/layout-xlarge-v11/remote_tabs_group.xml \
   res/layout-xlarge-v11/tabs_panel_toolbar_menu.xml \
   res/layout-xlarge-v11/tabs_row.xml \
@@ -1057,17 +1051,16 @@ MOZ_ANDROID_DRAWABLES += \
   mobile/android/base/resources/drawable/progress_spinner_9.png                 \
   mobile/android/base/resources/drawable/progress_spinner_10.png                \
   mobile/android/base/resources/drawable/progress_spinner_11.png                \
   mobile/android/base/resources/drawable/progress_spinner_12.png                \
   mobile/android/base/resources/drawable/remote_tabs_level.xml                  \
   mobile/android/base/resources/drawable/start.png                              \
   mobile/android/base/resources/drawable/site_security_level.xml                \
   mobile/android/base/resources/drawable/suggestion_selector.xml                \
-  mobile/android/base/resources/drawable/tab_new_button.xml                     \
   mobile/android/base/resources/drawable/tabs_button.xml                        \
   mobile/android/base/resources/drawable/tabs_level.xml                         \
   mobile/android/base/resources/drawable/tabs_panel_indicator.xml               \
   mobile/android/base/resources/drawable/tabs_tray_bg_repeat.xml                \
   mobile/android/base/resources/drawable/tabs_tray_selected_bg_repeat.xml       \
   mobile/android/base/resources/drawable/tabs_tray_active_selector.xml          \
   mobile/android/base/resources/drawable/tabs_tray_default_selector.xml         \
   mobile/android/base/resources/drawable/tabs_tray_list_divider.xml             \
@@ -1076,17 +1069,17 @@ MOZ_ANDROID_DRAWABLES += \
   mobile/android/base/resources/drawable/marketplace.png                        \
   mobile/android/base/resources/drawable/webapp_titlebar_bg.xml                 \
   $(NULL)
 
 MOZ_BRANDING_DRAWABLE_MDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn | tr '\n' ' ';  fi)
 MOZ_BRANDING_DRAWABLE_HDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-hdpi.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-hdpi.mn | tr '\n' ' ';  fi)
 MOZ_BRANDING_DRAWABLE_XHDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-xhdpi.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-xhdpi.mn | tr '\n' ' ';  fi)
 
-RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_LAND_V14) $(RES_LAYOUT_LARGE_V11) $(RES_LAYOUT_XLARGE_V11) $(RES_VALUES) $(RES_VALUES_LAND) $(RES_VALUES_V11) $(RES_VALUES_LARGE_V11) $(RES_VALUES_XLARGE_V11) $(RES_VALUES_LAND_V14) $(RES_XML) $(RES_ANIM) $(RES_DRAWABLE_NODPI) $(RES_DRAWABLE_BASE) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_XHDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LAND_V14) $(RES_DRAWABLE_LAND_MDPI_V14) $(RES_DRAWABLE_LAND_HDPI_V14) $(RES_DRAWABLE_LAND_XHDPI_V14) $(RES_DRAWABLE_LARGE_MDPI_V11) $(RES_DRAWABLE_LARGE_HDPI_V11) $(RES_DRAWABLE_LARGE_XHDPI_V11) $(RES_DRAWABLE_XLARGE_MDPI_V11) $(RES_DRAWABLE_XLARGE_HDPI_V11) $(RES_DRAWABLE_XLARGE_XHDPI_V11) $(RES_COLOR) $(RES_MENU)
+RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_LARGE_V11) $(RES_LAYOUT_XLARGE_V11) $(RES_VALUES) $(RES_VALUES_LAND) $(RES_VALUES_V11) $(RES_VALUES_LARGE_V11) $(RES_VALUES_XLARGE_V11) $(RES_VALUES_LAND_V14) $(RES_XML) $(RES_ANIM) $(RES_DRAWABLE_NODPI) $(RES_DRAWABLE_BASE) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_XHDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LAND_V14) $(RES_DRAWABLE_LAND_MDPI_V14) $(RES_DRAWABLE_LAND_HDPI_V14) $(RES_DRAWABLE_LAND_XHDPI_V14) $(RES_DRAWABLE_LARGE_MDPI_V11) $(RES_DRAWABLE_LARGE_HDPI_V11) $(RES_DRAWABLE_LARGE_XHDPI_V11) $(RES_DRAWABLE_XLARGE_MDPI_V11) $(RES_DRAWABLE_XLARGE_HDPI_V11) $(RES_DRAWABLE_XLARGE_XHDPI_V11) $(RES_COLOR) $(RES_MENU)
 
 RES_DIRS= \
   res/layout                    \
   res/layout-land-v14           \
   res/layout-large-v11          \
   res/layout-xlarge-v11         \
   res/layout-xlarge-land-v11    \
   res/values                    \
--- a/mobile/android/base/TabsPanel.java
+++ b/mobile/android/base/TabsPanel.java
@@ -19,17 +19,16 @@ import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.FrameLayout;
 import android.widget.ImageButton;
 import android.widget.LinearLayout;
-import android.widget.RelativeLayout;
 import android.widget.TabHost;
 import android.widget.TabHost.TabSpec;
 import android.widget.TabWidget;
 import android.widget.TextView;
 
 public class TabsPanel extends TabHost
                        implements GeckoPopupMenu.OnMenuItemClickListener,
                                   LightweightTheme.OnChangeListener {
@@ -156,18 +155,16 @@ public class TabsPanel extends TabHost
             }
         });
     }
 
     void initToolbar() {
         mToolbar = (TabsPanelToolbar) findViewById(R.id.toolbar);
 
         mTabWidget = (TabWidget) findViewById(android.R.id.tabs);
-        mTabWidget.setDividerDrawable(null);
-        mTabWidget.setStripEnabled(false);
 
         mAddTab = (ImageButton) mToolbar.findViewById(R.id.add_tab);
         mAddTab.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
                 mActivity.addTab();
                 mActivity.autoHideTabs();
             }
         });
@@ -342,30 +339,30 @@ public class TabsPanel extends TabHost
                 super.onMeasure(widthMeasureSpec, heightSpec);
             } else {
                 super.onMeasure(widthMeasureSpec, heightMeasureSpec);
             }
         }
     }
 
     // Tabs Panel Toolbar contains the Buttons
-    public static class TabsPanelToolbar extends RelativeLayout 
+    public static class TabsPanelToolbar extends LinearLayout 
                                          implements LightweightTheme.OnChangeListener {
         private BrowserApp mActivity;
 
         public TabsPanelToolbar(Context context, AttributeSet attrs) {
             super(context, attrs);
             mActivity = (BrowserApp) context;
 
             setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
                                                           (int) context.getResources().getDimension(R.dimen.browser_toolbar_height)));
 
+            setOrientation(LinearLayout.HORIZONTAL);
+
             LayoutInflater.from(context).inflate(R.layout.tabs_panel_toolbar_menu, this);
-            TabWidget tabWidget = (TabWidget) findViewById(android.R.id.tabs);
-            tabWidget.setStripEnabled(false);
         }
 
         @Override
         public void onAttachedToWindow() {
             super.onAttachedToWindow();
             mActivity.getLightweightTheme().addListener(this);
         }
 
deleted file mode 100644
--- a/mobile/android/base/TabsPanelButton.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.Canvas;
-import android.graphics.Path;
-import android.graphics.PorterDuff.Mode;
-import android.graphics.drawable.LayerDrawable;
-import android.graphics.drawable.StateListDrawable;
-import android.util.AttributeSet;
-
-public class TabsPanelButton extends ShapedButton {
-
-    public TabsPanelButton(Context context, AttributeSet attrs) {
-        super(context, attrs);
-
-        // Path is clipped.
-        mPath = new Path();
-        mCanvasDelegate = new CanvasDelegate(this, Mode.DST_OUT);
-    }
-
-    @Override
-    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-
-        int width = getMeasuredWidth();
-        int height = getMeasuredHeight();
-        float curve = height * 1.125f;
-
-        mPath.reset();
-
-        // Clipping happens on opposite side for menu.
-        if (mSide == CurveTowards.LEFT) {
-            mPath.moveTo(0, height);
-            mPath.cubicTo(curve * 0.75f, height,
-                          curve * 0.25f, 0,
-                          curve, 0);
-            mPath.lineTo(0, 0);
-            mPath.lineTo(0, height);
-        } else if (mSide == CurveTowards.RIGHT) {
-            mPath.moveTo(width, height);
-            mPath.cubicTo((width - (curve * 0.75f)), height,
-                          (width - (curve * 0.25f)), 0,
-                          (width - curve), 0);
-            mPath.lineTo(width, 0);
-            mPath.lineTo(width, height);
-        }
-    }
-
-    // The drawable is constructed as per @drawable/tab_new_button.
-    @Override
-    public void onLightweightThemeChanged() {
-        LightweightThemeDrawable drawable = mActivity.getLightweightTheme().getTextureDrawable(this, R.drawable.tabs_tray_bg_repeat);
-        if (drawable == null)
-            return;
-
-        drawable.setAlpha(34, 34);
-
-        Resources resources = getContext().getResources();
-        StateListDrawable stateList = new StateListDrawable();
-        stateList.addState(new int[] { android.R.attr.state_pressed }, resources.getDrawable(R.drawable.highlight));
-        stateList.addState(new int[] {}, drawable);
-
-        setBackgroundDrawable(stateList);
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        setBackgroundResource(R.drawable.tab_new_button);
-    }
-}
deleted file mode 100644
--- a/mobile/android/base/resources/drawable/tab_new_button.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item android:state_pressed="true" android:drawable="@drawable/highlight"/>
-    <item android:drawable="@drawable/tabs_tray_bg_repeat"/>
-
-</selector>
deleted file mode 100644
--- a/mobile/android/base/resources/layout-land-v14/tabs_panel_toolbar_menu.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <RelativeLayout android:layout_width="fill_parent"
-                    android:layout_height="fill_parent">
-
-        <org.mozilla.gecko.MenuButton android:id="@+id/menu"
-                                      style="@style/AddressBar.ImageButton"
-                                      android:layout_width="65dip"
-                                      android:layout_alignParentRight="true"
-                                      android:gravity="center_vertical"
-                                      android:src="@drawable/menu"
-                                      android:contentDescription="@string/menu"
-                                      android:background="@drawable/menu_button"
-                                      android:paddingLeft="35dip"
-                                      android:paddingRight="10dip"
-                                      android:enabled="false"/>
-
-        <LinearLayout android:layout_width="fill_parent"
-                      android:layout_height="fill_parent"
-                      android:layout_marginRight="15dip">
-
-            <TabWidget android:id="@android:id/tabs"
-                       android:layout_width="0dip"
-                       android:layout_height="fill_parent"
-                       android:layout_weight="1.0"/>
-
-            <Button android:id="@+id/tabs_menu"
-                    android:layout_width="0dip"
-                    android:layout_height="0dip"
-                    android:visibility="gone"/>
-
-            <org.mozilla.gecko.TabsPanelButton android:id="@+id/add_tab"
-                                               android:layout_width="63dip"
-                                               android:layout_height="@dimen/browser_toolbar_height"
-                                               android:gravity="center_vertical"
-                                               android:paddingLeft="10dip"
-                                               android:paddingRight="33dip"
-                                               android:src="@drawable/tab_new"
-                                               android:contentDescription="@string/new_tab"
-                                               android:background="@drawable/tab_new_button"/>
-
-        </LinearLayout>
-
-    </RelativeLayout>
-
-</merge>
deleted file mode 100644
--- a/mobile/android/base/resources/layout-large-v11/tabs_panel_toolbar_menu.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <RelativeLayout android:layout_width="fill_parent"
-                    android:layout_height="fill_parent">
-
-        <org.mozilla.gecko.MenuButton android:id="@+id/menu"
-                                      style="@style/AddressBar.ImageButton"
-                                      android:layout_width="90dip"
-                                      android:layout_alignParentRight="true"
-                                      android:gravity="center_vertical"
-                                      android:src="@drawable/menu"
-                                      android:contentDescription="@string/menu"
-                                      android:background="@drawable/menu_button"
-                                      android:paddingLeft="48dip"
-                                      android:paddingRight="14dip"
-                                      android:enabled="false"/>
-
-        <LinearLayout android:layout_width="fill_parent"
-                      android:layout_height="fill_parent"
-                      android:layout_marginRight="28dip">
-
-            <TabWidget android:id="@android:id/tabs"
-                       android:layout_width="0dip"
-                       android:layout_height="fill_parent"
-                       android:layout_weight="1.0"/>
-
-            <Button android:id="@+id/tabs_menu"
-                    android:layout_width="0dip"
-                    android:layout_height="0dip"
-                    android:visibility="gone"/>
-
-            <org.mozilla.gecko.TabsPanelButton android:id="@+id/add_tab"
-                                               android:layout_width="85dip"
-                                               android:layout_height="@dimen/browser_toolbar_height"
-                                               android:gravity="center_vertical"
-                                               android:paddingLeft="14dip"
-                                               android:paddingRight="43dip"
-                                               android:src="@drawable/tab_new"
-                                               android:contentDescription="@string/new_tab"
-                                               android:background="@drawable/tab_new_button"/>
-
-        </LinearLayout>
-
-    </RelativeLayout>
-
-</merge>
--- a/mobile/android/base/resources/layout-xlarge-v11/tabs_panel_toolbar_menu.xml
+++ b/mobile/android/base/resources/layout-xlarge-v11/tabs_panel_toolbar_menu.xml
@@ -1,48 +1,43 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <LinearLayout android:layout_width="fill_parent"
-                  android:layout_height="fill_parent">
-
-        <TabWidget android:id="@android:id/tabs"
-                   android:layout_width="0dip"
-                   android:layout_height="0dip"
-                   android:visibility="gone"/>
+    <TabWidget android:id="@android:id/tabs"
+               android:layout_width="0dip"
+               android:layout_height="0dip"
+               android:visibility="gone"/>
 
-        <Button android:id="@+id/tabs_menu"
-                android:layout_width="0dip"
-                android:layout_height="fill_parent"
-                android:layout_weight="1.0"
-                android:text="@string/tabs_normal"
-                android:textColor="@color/tabs_counter_color"
-                android:background="@drawable/action_bar_button"/>
+    <Button android:id="@+id/tabs_menu"
+            android:layout_width="0dip"
+            android:layout_height="fill_parent"
+            android:layout_weight="1.0"
+            android:text="@string/tabs_normal"
+            android:textColor="@color/tabs_counter_color"
+            android:background="@drawable/action_bar_button"/>
 
-        <ImageButton android:id="@+id/add_tab"
-                     android:layout_width="@dimen/browser_toolbar_height"
-                     android:layout_height="@dimen/browser_toolbar_height"
-                     android:paddingTop="15dip"
-                     android:paddingBottom="15dip"
-                     android:paddingLeft="20dip"
-                     android:paddingRight="20dip"
-                     android:src="@drawable/tab_new"
-                     android:contentDescription="@string/new_tab"
-                     android:background="@drawable/action_bar_button"/>
+    <ImageButton android:id="@+id/add_tab"
+                 android:layout_width="@dimen/browser_toolbar_height"
+                 android:layout_height="@dimen/browser_toolbar_height"
+                 android:paddingTop="15dip"
+                 android:paddingBottom="15dip"
+                 android:paddingLeft="20dip"
+                 android:paddingRight="20dip"
+                 android:src="@drawable/tab_new"
+                 android:contentDescription="@string/new_tab"
+                 android:background="@drawable/action_bar_button"/>
 
-        <ImageButton android:id="@+id/menu"
-                     android:layout_width="@dimen/browser_toolbar_height"
-                     android:layout_height="@dimen/browser_toolbar_height"
-                     android:paddingTop="15dip"
-                     android:paddingBottom="15dip"
-                     android:paddingLeft="20dip"
-                     android:paddingRight="20dip"
-                     android:src="@drawable/tabs_menu"
-                     android:contentDescription="@string/menu"
-                     android:background="@drawable/action_bar_button"/>
-
-    </LinearLayout>
+    <ImageButton android:id="@+id/menu"
+                 android:layout_width="@dimen/browser_toolbar_height"
+                 android:layout_height="@dimen/browser_toolbar_height"
+                 android:paddingTop="15dip"
+                 android:paddingBottom="15dip"
+                 android:paddingLeft="20dip"
+                 android:paddingRight="20dip"
+                 android:src="@drawable/tabs_menu"
+                 android:contentDescription="@string/menu"
+                 android:background="@drawable/action_bar_button"/>
 
 </merge>
--- a/mobile/android/base/resources/layout/tabs_panel_toolbar_menu.xml
+++ b/mobile/android/base/resources/layout/tabs_panel_toolbar_menu.xml
@@ -1,51 +1,38 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <RelativeLayout android:layout_width="fill_parent"
-                    android:layout_height="fill_parent">
+    <TabWidget android:id="@android:id/tabs"
+               android:layout_width="0dip"
+               android:layout_height="fill_parent"
+               android:layout_weight="1.0"
+               android:tabStripEnabled="false"
+               android:drawable="@null"/>
 
-        <org.mozilla.gecko.MenuButton android:id="@+id/menu"
-                                      style="@style/AddressBar.ImageButton"
-                                      android:layout_width="78dip"
-                                      android:layout_alignParentRight="true"
-                                      android:gravity="center_vertical"
-                                      android:src="@drawable/menu"
-                                      android:contentDescription="@string/menu"
-                                      android:background="@drawable/menu_button"
-                                      android:paddingLeft="42dip"
-                                      android:paddingRight="12dip"
-                                      android:enabled="false"/>
-
-        <LinearLayout android:layout_width="fill_parent"
-                      android:layout_height="fill_parent"
-                      android:layout_marginRight="22dip">
+    <Button android:id="@+id/tabs_menu"
+            android:layout_width="0dip"
+            android:layout_height="0dip"
+            android:visibility="gone"/>
 
-            <TabWidget android:id="@android:id/tabs"
-                       android:layout_width="0dip"
-                       android:layout_height="fill_parent"
-                       android:layout_weight="1.0"/>
-
-            <Button android:id="@+id/tabs_menu"
-                    android:layout_width="0dip"
-                    android:layout_height="0dip"
-                    android:visibility="gone"/>
+    <ImageButton android:id="@+id/add_tab"
+                 style="@style/AddressBar.ImageButton"
+                 android:layout_width="@dimen/browser_toolbar_height"
+                 android:layout_height="@dimen/browser_toolbar_height"
+                 android:padding="@dimen/browser_toolbar_button_padding"
+                 android:src="@drawable/tab_new"
+                 android:contentDescription="@string/new_tab"
+                 android:background="@drawable/action_bar_button"/>
 
-            <org.mozilla.gecko.TabsPanelButton android:id="@+id/add_tab"
-                                               android:layout_width="75dip"
-                                               android:layout_height="@dimen/browser_toolbar_height"
-                                               android:gravity="center_vertical"
-                                               android:paddingLeft="12dip"
-                                               android:paddingRight="39dip"
-                                               android:src="@drawable/tab_new"
-                                               android:contentDescription="@string/new_tab"
-                                               android:background="@drawable/tab_new_button"/>
-
-        </LinearLayout>
-
-    </RelativeLayout>
+    <ImageButton android:id="@+id/menu"
+                 style="@style/AddressBar.ImageButton"
+                 android:layout_width="@dimen/browser_toolbar_height"
+                 android:layout_height="@dimen/browser_toolbar_height"
+                 android:padding="@dimen/browser_toolbar_button_padding"
+                 android:src="@drawable/menu"
+                 android:contentDescription="@string/menu"
+                 android:background="@drawable/action_bar_button"/>
 
 </merge>
--- a/mobile/android/base/resources/values-land-v14/dimens.xml
+++ b/mobile/android/base/resources/values-land-v14/dimens.xml
@@ -1,12 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
 
     <dimen name="browser_toolbar_height">40dp</dimen>
+    <dimen name="browser_toolbar_button_padding">10dp</dimen>
     <dimen name="browser_toolbar_icon_width">46dp</dimen>
     <dimen name="tabs_counter_size">18sp</dimen>
 
 </resources>
--- a/mobile/android/base/resources/values-large-v11/dimens.xml
+++ b/mobile/android/base/resources/values-large-v11/dimens.xml
@@ -1,15 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
 
     <dimen name="browser_toolbar_height">56dp</dimen>
+    <dimen name="browser_toolbar_button_padding">14dp</dimen>
     <dimen name="browser_toolbar_icon_width">45dp</dimen>
     <dimen name="menu_popup_arrow_margin">8dip</dimen>
     <dimen name="tabs_counter_size">26sp</dimen>
     <dimen name="addressbar_offset_left">90dp</dimen>
     <dimen name="addressbar_offset_left_noforward">50dip</dimen>
 
 </resources>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -16,16 +16,17 @@
     <dimen name="awesomebar_header_row_height">20dp</dimen>
     <dimen name="awesomebar_row_height">48dp</dimen>
     <dimen name="awesomebar_row_favicon_size_small">16dp</dimen>
     <dimen name="awesomebar_row_favicon_size_large">32dp</dimen>
     <dimen name="awesomebar_row_favicon_bg">32dp</dimen>
     <dimen name="awesomebar_row_favicon_bg_radius">1dp</dimen>
     <dimen name="awesomebar_tab_transparency_height">38dp</dimen>
     <dimen name="browser_toolbar_height">48dp</dimen>
+    <dimen name="browser_toolbar_button_padding">12dp</dimen>
     <dimen name="browser_toolbar_icon_width">36dp</dimen>
     <dimen name="browser_toolbar_lock_width">21.33dp</dimen>
     <dimen name="browser_toolbar_favicon_size">29.33dip</dimen>
     <dimen name="doorhanger_arrow_width">44dp</dimen>
     <dimen name="flow_layout_spacing">6dp</dimen>
     <dimen name="local_tab_row_height">108dp</dimen>
     <dimen name="menu_item_row_height">44dp</dimen>
     <dimen name="menu_item_row_width">240dp</dimen>