diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index 52f9a2b3e687..d630737d2ae7 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -209,8 +209,8 @@ accesskey="&viewMenu.accesskey;"> ") + .appendTo($container); + + this.$ntb .addClass('newTabButton') .click(function() { self.newTab(); - }) - .attr('title', - "New tab") - .appendTo($container); + }); + + (this.$ntb)[0].title = 'New tab'; // ___ Resizer this.$resizer = iQ("
") @@ -167,7 +169,7 @@ let GroupItem = function GroupItem(listOfEls, options) { this.$titleContainer = iQ('.title-container', this.$titlebar); this.$title = iQ('.name', this.$titlebar); this.$titleShield = iQ('.title-shield', this.$titlebar); - this.setTitle(options.title || this.defaultName); + this.setTitle(options.title || ""); var titleUnfocus = function() { self.$titleShield.show(); @@ -296,7 +298,7 @@ window.GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), { // ---------- // Variable: defaultName // The prompt text for the title field. - defaultName: "Name this tab group…", + defaultName: "name this groupItem...", // ----------- // Function: setActiveTab @@ -372,7 +374,7 @@ window.GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), { adjustTitleSize: function() { Utils.assert(this.bounds, 'bounds needs to have been set'); let closeButton = iQ('.close', this.container); - var w = Math.min(this.bounds.width - parseInt(closeButton.width()) - parseInt(closeButton.css('right')), + var w = Math.min(this.bounds.width - closeButton.width() - closeButton.css('right'), Math.max(150, this.getTitle().length * 6)); // The * 6 multiplier calculation is assuming that characters in the title // are approximately 6 pixels wide. Bug 586545 @@ -653,10 +655,7 @@ window.GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), { } if (!options.dontArrange) { - // by default, we animate the item moving to its new position - let animate = typeof options.animate == "undefined" ? true : - options.animate; - this.arrange({ animate: animate }); + this.arrange(); } UI.setReorderTabsOnHide(this); @@ -1798,9 +1797,8 @@ window.GroupItems = { // Function: killNewTabGroup // Removes the New Tab Group, which is now defunct. See bug 575851 and comments therein. killNewTabGroup: function() { - let newTabGroupTitle = "New Tabs"; this.groupItems.forEach(function(groupItem) { - if (groupItem.getTitle() == newTabGroupTitle && groupItem.locked.title) { + if (groupItem.getTitle() == 'New Tabs' && groupItem.locked.title) { groupItem.removeAll(); groupItem.close(); } diff --git a/browser/base/content/tabview/iq.js b/browser/base/content/tabview/iq.js index 08983a83133f..690874d51280 100644 --- a/browser/base/content/tabview/iq.js +++ b/browser/base/content/tabview/iq.js @@ -531,7 +531,9 @@ iQClass.prototype = { options = {}; let easings = { - tabviewBounce: "cubic-bezier(0.0, 0.63, .6, 1.29)", + tabviewBounce: "cubic-bezier(0.0, 0.63, .6, 1.0)", + // TODO: change 1.0 above to 1.29 after bug 575672 is fixed + easeInQuad: 'ease-in', // TODO: make it a real easeInQuad, or decide we don't care fast: 'cubic-bezier(0.7,0,1,1)' }; diff --git a/browser/base/content/tabview/items.js b/browser/base/content/tabview/items.js index d77083315684..fff99e3ca511 100644 --- a/browser/base/content/tabview/items.js +++ b/browser/base/content/tabview/items.js @@ -1048,7 +1048,7 @@ window.Items = { var bounds2 = pair2.bounds; if (bounds2.intersects(newBounds)) blocked = true; - return; + return; }); if (!blocked) { diff --git a/browser/base/content/tabview/tabview.css b/browser/base/content/tabview/tabview.css index 9a2ec1fd3a61..6e6179a9fd39 100644 --- a/browser/base/content/tabview/tabview.css +++ b/browser/base/content/tabview/tabview.css @@ -347,11 +347,11 @@ input.name { padding-left: 20px; } -.title-container:hover input.name { +input.name:hover { border: 1px solid #ddd; } -.title-container:hover input.name-locked { +input.name-locked:hover { border: 1px solid transparent !important; cursor: default; } @@ -366,7 +366,7 @@ input.defaultName { color: transparent; } -.title-container:hover input.defaultName { +input.defaultName:hover { color: #CCC; } diff --git a/browser/base/content/tabview/ui.js b/browser/base/content/tabview/ui.js index c3ed185daa2a..dea337aeaa0b 100644 --- a/browser/base/content/tabview/ui.js +++ b/browser/base/content/tabview/ui.js @@ -107,12 +107,7 @@ var UIManager = { this._currentTab = gBrowser.selectedTab; // ___ Dev Menu - // This dev menu is not meant for shipping, nor is it of general - // interest, but we still need it for the time being. Change the - // false below to enable; just remember to change back before - // committing. Bug 586721 will track the ultimate removal. - if (false) - this._addDevMenu(); + this._addDevMenu(); // When you click on the background/empty part of TabView, // we create a new groupItem. @@ -158,10 +153,6 @@ var UIManager = { GroupItems.reconstitute(groupItemsData, groupItemData); GroupItems.killNewTabGroup(); // temporary? - // ___ tabs - TabItems.init(); - TabItems.pausePainting(); - if (firstTime) { var padding = 10; var infoWidth = 350; @@ -185,18 +176,15 @@ var UIManager = { if (item.parent) item.parent.remove(item); - groupItem.add(item, null, {animate: false}); + groupItem.add(item); }); // ___ make info item - let welcome = "How to organize your tabs"; - let more = ""; - let video = "http://videos-cdn.mozilla.net/firefox4beta/tabcandy_howto.webm"; var html = "
" - + "

" + welcome + "

" - + ( more && more.length ? "
" + more + "

" : "") - + "
"; @@ -207,6 +195,10 @@ var UIManager = { infoItem.html(html); } + // ___ tabs + TabItems.init(); + TabItems.pausePainting(); + // ___ resizing if (this._pageBounds) this._resize(true); @@ -312,7 +304,7 @@ var UIManager = { #ifdef XP_WIN // Restore the full height when showing TabView - gTabViewFrame.style.marginTop = "22px"; + gTabViewFrame.style.marginTop = 0; #endif gTabViewDeck.selectedIndex = 1; gTabViewFrame.contentWindow.focus(); @@ -440,6 +432,14 @@ var UIManager = { tab.tabItem.setZoomPrep(false); self.showTabView(); } + // ToDo: When running unit tests, everything happens so quick so + // new tabs might be added after a tab is closing. Therefore, this + // hack is used. We should look for a better solution. + setTimeout(function() { // Marshal event from chrome thread to DOM thread + if ((groupItem && groupItem._children.length > 0) || + (groupItem == null && gBrowser.visibleTabs.length > 0)) + self.hideTabView(); + }, 1); } } }); @@ -636,7 +636,7 @@ var UIManager = { !event.ctrlKey) { #else if (event.ctrlKey && !event.metaKey && !event.shiftKey && - !event.altKey) { + event.altKey) { #endif var activeTab = self.getActiveTab(); if (activeTab) diff --git a/browser/base/content/test/tabview/browser_tabview_launch.js b/browser/base/content/test/tabview/browser_tabview_launch.js index 8fc13ac95993..6391c0b9a73b 100644 --- a/browser/base/content/test/tabview/browser_tabview_launch.js +++ b/browser/base/content/test/tabview/browser_tabview_launch.js @@ -56,7 +56,7 @@ function test() { eventObject = { altKey: true }; } else { charCode = 32; - eventObject = { ctrlKey: true }; + eventObject = { altKey: true, ctrlKey: true }; } var modifiers = EventUtils._parseModifiers(eventObject); var keyDownDefaultHappened = diff --git a/browser/locales/en-US/chrome/browser/browser.dtd b/browser/locales/en-US/chrome/browser/browser.dtd index 1084f3decac1..c008e8b13230 100644 --- a/browser/locales/en-US/chrome/browser/browser.dtd +++ b/browser/locales/en-US/chrome/browser/browser.dtd @@ -132,8 +132,8 @@ - - + + @@ -240,8 +240,8 @@ - - + + diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index 082be0c7db29..3c9cdf8501cc 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -276,7 +276,7 @@ ctrlTab.showAll.label=;Show all #1 tabs addKeywordTitleAutoFill=Search %S # TabView -tabView2.title=%S - Group Your Tabs +tabView.title=%S Tab Sets extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.