mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 765805 (2/3) - Don't hide the tab sidebar when adding a new tab [r=sriram]
This commit is contained in:
parent
208198435c
commit
34ae538ae2
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user