Bug 588593 - Can't right-click-move tab to un-named tab group; r=ttaubert

This commit is contained in:
Andres Hernandez [:andreshm] 2012-05-30 11:17:20 +08:00
parent 9417a0976f
commit 7dbe368767
3 changed files with 27 additions and 4 deletions

View File

@ -292,7 +292,7 @@ let TabView = {
// if group has title, it's not hidden and there is no active group or
// the active group id doesn't match the group id, a group menu item
// would be added.
if (groupItem.getTitle().length > 0 && !groupItem.hidden &&
if (!groupItem.hidden && groupItem.getChildren().length &&
(!activeGroup || activeGroup.id != groupItem.id)) {
let menuItem = self._createGroupMenuItem(groupItem);
popup.insertBefore(menuItem, separator);
@ -305,8 +305,25 @@ let TabView = {
// ----------
_createGroupMenuItem: function TabView__createGroupMenuItem(groupItem) {
let menuItem = document.createElement("menuitem")
menuItem.setAttribute("label", groupItem.getTitle());
let menuItem = document.createElement("menuitem");
let title = groupItem.getTitle();
if (!title.trim()) {
let topChildLabel = groupItem.getTopChild().tab.label;
if (groupItem.getChildren().length > 1) {
title =
gNavigatorBundle.getFormattedString("tabview2.moveToUnnamedGroup.label",
[topChildLabel, groupItem.getChildren().length - 1]);
} else {
title = topChildLabel;
}
}
menuItem.setAttribute("label", title);
menuItem.setAttribute("tooltiptext", title);
menuItem.setAttribute("crop", "center");
menuItem.setAttribute("class", "tabview-menuitem");
menuItem.setAttribute(
"oncommand",
"TabView.moveTabTo(TabContextMenu.contextTab,'" + groupItem.id + "')");

View File

@ -545,5 +545,10 @@ statuspanel[inactive][previoustype=overLink] {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
}
/* tabview menus */
.tabview-menuitem {
max-width: 32em;
}
/* highlighter */
%include highlighter.css

View File

@ -306,6 +306,7 @@ addKeywordTitleAutoFill=Search %S
# TabView
tabView2.title=%S - Group Your Tabs
tabview2.moveToUnnamedGroup.label=%S and %S more
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.