Bug 765805 (2/3) - Don't hide the tab sidebar when adding a new tab [r=sriram]

This commit is contained in:
Matt Brubeck 2012-06-19 13:37:57 -07:00
parent 6ceac710b7
commit 333b2454e8
2 changed files with 13 additions and 2 deletions

View File

@ -67,7 +67,7 @@ public class TabsPanel extends LinearLayout {
addTab.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
GeckoApp.mAppContext.addTab();
hide();
GeckoApp.mAppContext.autoHideTabs();
}
});

View File

@ -125,11 +125,18 @@ public class TabsTray extends LinearLayout
return;
}
int index = Tabs.getInstance().getIndexOf(tab);
if (msg == Tabs.TabEvents.ADDED) {
mTabsAdapter.addTab(index, tab);
mTabsAdapter.notifyDataSetChanged();
return;
}
int position = mTabsAdapter.getPositionForTab(tab);
if (position == -1)
return;
if (Tabs.getInstance().getIndexOf(tab) == -1) {
if (index == -1) {
mWaitingForClose = false;
mTabsAdapter.removeTab(tab);
mTabsAdapter.notifyDataSetChanged();
@ -213,6 +220,10 @@ public class TabsTray extends LinearLayout
return mTabs.indexOf(tab);
}
public void addTab(int index, Tab tab) {
mTabs.add(index, tab);
}
public void removeTab(Tab tab) {
mTabs.remove(tab);
}