Last Comment Bug 721327 - Implement Tabs Toolbar for Thunderbird and Lightning Compatibility.
: Implement Tabs Toolbar for Thunderbird and Lightning Compatibility.
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: MailNews: General (show other bugs)
: Trunk
: All All
: -- normal (vote)
: seamonkey2.10
Assigned To: Philip Chee
:
Mentors:
Depends on:
Blocks: 719031
  Show dependency treegraph
 
Reported: 2012-01-26 02:49 PST by Philip Chee
Modified: 2012-03-03 09:36 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed
fixed
fixed


Attachments
Patch v1.0 Proposed fix. (3.55 KB, patch)
2012-01-26 02:56 PST, Philip Chee
no flags Details | Diff | Splinter Review
Patch v1.1 Better fix. (4.14 KB, patch)
2012-02-14 04:49 PST, Philip Chee
stefanh: ui‑review+
Details | Diff | Splinter Review
Patch v1.2 Use id selector in CSS. ui-r=stefanh. (4.14 KB, patch)
2012-02-16 07:38 PST, Philip Chee
no flags Details | Diff | Splinter Review
Patch v1.3 Fix More Nits ui-r=stefanh. (4.11 KB, patch)
2012-02-17 02:58 PST, Philip Chee
neil: review+
philip.chee: ui‑review+
bugspam.Callek: approval‑comm‑aurora-
bugspam.Callek: approval‑comm‑beta-
Details | Diff | Splinter Review
Patch v2.1 L10n safe Branch Patch. (4.24 KB, patch)
2012-02-27 11:28 PST, Philip Chee
neil: review-
Details | Diff | Splinter Review
Patch v2.2 Branch patch with non-customizable toolbar. (2.82 KB, patch)
2012-03-02 01:40 PST, Philip Chee
neil: review+
bugspam.Callek: approval‑comm‑aurora+
bugspam.Callek: approval‑comm‑beta+
Details | Diff | Splinter Review

Description Philip Chee 2012-01-26 02:49:46 PST
Lighting moved their tabbar buttons into the new Thunderbird tabbar-toolbar. We should somehow support this.
Comment 1 Philip Chee 2012-01-26 02:56:06 PST
Created attachment 591731 [details] [diff] [review]
Patch v1.0 Proposed fix.

> +++ b/suite/themes/modern/messenger/mailWindow1.css
> 
> +.tabbar-toolbar {
> +  border-bottom: 1px solid #000000;
> +  min-height: 0;
> +}
Couldn't find out why the bottom border disappeared so I added this hack.
Comment 2 neil@parkwaycc.co.uk 2012-02-12 15:01:07 PST
(In reply to Philip Chee from comment #1)
> > +.tabbar-toolbar {
> > +  border-bottom: 1px solid #000000;
> > +  min-height: 0;
> > +}
> Couldn't find out why the bottom border disappeared so I added this hack.
It's because the toolbar isn't transparent. It probably needs to be. I don't know if toolbars are transparent under Aero; they do have -moz-appearance and it might or might not need to be turned off, as well as the border, for which I'd prefer separate bottom/top border styles please.
Comment 3 Philip Chee 2012-02-14 04:49:04 PST
Created attachment 596969 [details] [diff] [review]
Patch v1.1 Better fix.

>> Couldn't find out why the bottom border disappeared so I added this hack.
> It's because the toolbar isn't transparent. It probably needs to be. I don't

Aha. Setting |background-color: transparent;| works.

> know if toolbars are transparent under Aero; they do have -moz-appearance
> and it might or might not need to be turned off,
Yeah I needed to turn off -moz-appearance for aero as I did in the v1 patch.

> as well as the border, for
> which I'd prefer separate bottom/top border styles please.
Done!

----------------------------------------------------------

Stefanh I don't have a Mac so I'm totally guessing here. Please recommend if
any styles are needed at all.

> +++ b/suite/themes/classic/mac/messenger/mailWindow1.css

> +
> +.tabbar-toolbar {
> +  -moz-appearance: none;
> +}
Comment 4 Philip Chee 2012-02-14 10:52:54 PST
> but I have one question: why not use the id selector?

I might want to reuse the class? Also:

http://csswizardry.com/2011/09/writing-efficient-css-selectors/

It is important to note that, although an ID is technically faster and more performant, it is barely so. Using Steve Souders’ CSS Test Creator we can see that an ID selector and a class selector show very little difference in reflow speed.

In Firefox 6 on a Windows machine I get an average reflow figure of 10.9 for a simple class selector. An ID selector gave a mean of 12.5, so this actually reflowed slower than a class.
Comment 5 Stefan [:stefanh] 2012-02-15 12:07:08 PST
Comment on attachment 596969 [details] [diff] [review]
Patch v1.1 Better fix.

Looks fine to me on Mac. But you should add 'nowindowdrag="true"' to the toolbar in messenger.xul. I'm pretty sure we don't want the transparent toolbar to be draggable ;-)

Actually, not using the nowindowdrag attribute made me spot an error in toolbar.css - we give the 'xpfe="false"' toolbars a grippy under certain circumstances (I'll fix that in a separate bug).

Re the class usage, I don't think there's any perf issues with using a class (even though I'm sceptical to the reflow results you're refering to), but I think it's confusing using a class on a unique element with an id attribute. Also, using a class forces you to add extra code, but you have the id for free.
Comment 6 Philip Chee 2012-02-16 07:38:09 PST
Created attachment 597812 [details] [diff] [review]
Patch v1.2 Use id selector in CSS. ui-r=stefanh.

> Looks fine to me on Mac. But you should add 'nowindowdrag="true"' to the
> toolbar in messenger.xul. I'm pretty sure we don't want the transparent
> toolbar to be draggable ;-)
Fixed.

> Re the class usage, I don't think there's any perf issues with using a class
> (even though I'm sceptical to the reflow results you're refering to), but I
> think it's confusing using a class on a unique element with an id attribute.
> Also, using a class forces you to add extra code, but you have the id for
> free.
Fixed.
Comment 7 neil@parkwaycc.co.uk 2012-02-16 07:52:01 PST
Comment on attachment 597812 [details] [diff] [review]
Patch v1.2 Use id selector in CSS. ui-r=stefanh.

>+  min-height: 0;
Don't pinstripe/Modern have a min-height that you need to override too?

>+@media (-moz-windows-theme: aero) {
There's no @media block in toolbar.css so I'd remove it for consistency.
Comment 8 Stefan [:stefanh] 2012-02-16 14:44:54 PST
(In reply to neil@parkwaycc.co.uk from comment #7)
> Comment on attachment 597812 [details] [diff] [review]
> Patch v1.2 Use id selector in CSS. f=stefanh.
> 
> >+  min-height: 0;
> Don't pinstripe/Modern have a min-height that you need to override too?

Ah, that's true.
Comment 9 Philip Chee 2012-02-17 02:58:26 PST
Created attachment 598189 [details] [diff] [review]
Patch v1.3 Fix More Nits ui-r=stefanh.

>>+  min-height: 0;
> Don't pinstripe/Modern have a min-height that you need to override too?
Fixed.

>>+@media (-moz-windows-theme: aero) {
> There's no @media block in toolbar.css so I'd remove it for consistency.
Fixed.
Comment 10 neil@parkwaycc.co.uk 2012-02-17 13:24:17 PST
Comment on attachment 598189 [details] [diff] [review]
Patch v1.3 Fix More Nits ui-r=stefanh.

>+#tabbar-toolbar {
>+  min-height: 0;
>+  background-color: transparent;
>+}
One last nit, put the min-height last for consistency with the other themes.
Comment 11 Philip Chee 2012-02-17 20:29:59 PST
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/a35da4eb6892
Comment 12 Philip Chee 2012-02-18 10:25:46 PST
Oops forgot to close this bug.
Comment 13 Philip Chee 2012-02-27 04:37:20 PST
Comment on attachment 598189 [details] [diff] [review]
Patch v1.3 Fix More Nits ui-r=stefanh.

[Approval Request Comment]
Regression caused by ): Lighting Bug 709572 - Add Calendar and Task toolbar for tabs on top 
User impact if declined: User will be unable to open a Calendar or Tasks tab even from the menu.
Testing completed (on m-c, etc.): Baked and tested on comm-central.
Risk to taking this patch (and alternatives if risky): low risk. Alternative is to write an addon but then we'd need to localize that addon too.
String changes made by this patch: Two additional strings.
 +<!ENTITY showTabsToolbarCmd.label "Tabs Toolbar">
 +<!ENTITY showTabsToolbarCmd.accesskey "T">
Comment 14 Justin Wood (:Callek) 2012-02-27 11:10:12 PST
Comment on attachment 598189 [details] [diff] [review]
Patch v1.3 Fix More Nits ui-r=stefanh.

Ratty seems to have a patch (from a convo in IRC) that would make this useable on beta/aurora without l10n changes.

Has a slight code-change to make it sane, but if that can pass a review I give it pre-emptive a+
Comment 15 Philip Chee 2012-02-27 11:16:51 PST
To summarize a IRC conversation with Callek a L10n safe patch for branches.

1. Remove the toolbarname and accesskey, thus removing the need for L10n entities.

2. Then modify utilityOverlay->onViewToolbarsPopupShowing() to take into account external toolbars without the "toolbarname" attribute.

replace:
  var toolbars = Array.slice(toolbox.getElementsByAttribute("toolbarname", "*"));
  toolbars = toolbars.concat(toolbox.externalToolbars);

with:
  var externalToolbars = Array.filter(toolbox.externalToolbars,
                                      function(toolbar) {
                                        return toolbar.hasAttribute("toolbarname")});
  var toolbars = Array.slice(toolbox.getElementsByAttribute("toolbarname", "*"));
  toolbars = toolbars.concat(externalToolbars);
Comment 16 Philip Chee 2012-02-27 11:28:33 PST
Created attachment 600988 [details] [diff] [review]
Patch v2.1 L10n safe Branch Patch.

Not tested on Aurora/Beta. But works on trunk.
Comment 17 Justin Wood (:Callek) 2012-02-27 12:23:09 PST
Comment on attachment 600988 [details] [diff] [review]
Patch v2.1 L10n safe Branch Patch.

Neil can you do a fast turnaround here, its just a branch version of what you reviewed already, but has js changes not in original.
Comment 18 Philip Chee 2012-02-27 17:25:38 PST
I should add that the js changes are needed on trunk as well to take into account third party external toolbars (from addons) that don't bother to have toolbarname attributes.
Comment 19 neil@parkwaycc.co.uk 2012-02-29 16:38:31 PST
Comment on attachment 600988 [details] [diff] [review]
Patch v2.1 L10n safe Branch Patch.

I don't see why we need to make the toolbar customisable on branch. I'm not even sure why we need it on trunk; the calendar buttons aren't removable, and it doesn't make sense to change the settings for the toolbar. At least on trunk the l10n changes allow us to hide the toolbar completely...
Comment 20 Philip Chee 2012-03-02 01:40:10 PST
Created attachment 602288 [details] [diff] [review]
Patch v2.2 Branch patch with non-customizable toolbar.

> I don't see why we need to make the toolbar customisable on branch. I'm not
> even sure why we need it on trunk; the calendar buttons aren't removable,
> and it doesn't make sense to change the settings for the toolbar. At least
> on trunk the l10n changes allow us to hide the toolbar completely...

The Thunderbird tabbar-toolbar which Lightning inserts it's button into is
customizable and is meant to be a replacement for the non-customizable
<box id="tabmail-buttons">.

The intention of TB is to get extensions to migrate any UI they insert in the
latter to the toolbar.

IIRC The lightning toolbar buttons are deliberately non-customizable.
Comment 21 Justin Wood (:Callek) 2012-03-02 14:17:36 PST
Comment on attachment 602288 [details] [diff] [review]
Patch v2.2 Branch patch with non-customizable toolbar.

[Triage Comment]

Note You need to log in before you can comment on or make changes to this bug.