Bug 282127: Highlight odd tree rows in trees with multiple columns in Gnomestripe and Pinstripe. Implement and use ::-moz-tree-row(multicol). ui-review=faaborg, r=enndeakin
authorSteffen Wilberg <steffen.wilberg@web.de>
Wed, 12 May 2010 20:25:48 +0200
changeset 42217 e719b565185c63a6e9f7f12886489494edd68fd3
parent 42216 7764b54578edd75c00e9e529f2f1ac7ecd34bd00
child 42218 44d9cb4f57964aaff15a6550792dba175d5d7046
push id13233
push usersteffen.wilberg@web.de
push dateWed, 12 May 2010 18:27:17 +0000
treeherdermozilla-central@e719b565185c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs282127
milestone1.9.3a5pre
first release with
nightly mac
e719b565185c / 3.7a5pre / 20100512113618 / files
nightly linux32
nightly linux64
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
releases
nightly mac
Bug 282127: Highlight odd tree rows in trees with multiple columns in Gnomestripe and Pinstripe. Implement and use ::-moz-tree-row(multicol). ui-review=faaborg, r=enndeakin
browser/themes/gnomestripe/browser/aboutSessionRestore.css
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
toolkit/components/viewconfig/content/config.xul
toolkit/themes/gnomestripe/global/tree.css
toolkit/themes/pinstripe/global/tree.css
--- a/browser/themes/gnomestripe/browser/aboutSessionRestore.css
+++ b/browser/themes/gnomestripe/browser/aboutSessionRestore.css
@@ -62,16 +62,25 @@ treechildren::-moz-tree-image(container,
 }
 treechildren::-moz-tree-image(checked) {
   list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif");
 }
 treechildren::-moz-tree-image(partial) {
   list-style-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif");
 }
 
+/* undo odd row highlighting from tree.css */
+treechildren::-moz-tree-row(odd) {
+  background-color: transparent;
+}
+treechildren::-moz-tree-row(odd, selected, focus) {
+  background-color: Highlight;
+}
+
+/* highlight "windows" instead */
 treechildren::-moz-tree-row(alternate) {
   background-color: -moz-oddtreerow;
 }
 treechildren::-moz-tree-row(alternate, selected) {
   background-color: Highlight;
 }
 
 #buttons {
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -2032,16 +2032,20 @@ nsTreeBodyFrame::PrefillPropertyArray(PR
     if (aRowIndex % 2)
       mScratchArray->AppendElement(nsGkAtoms::odd);
     else
       mScratchArray->AppendElement(nsGkAtoms::even);
 
     nsIContent* baseContent = GetBaseElement();
     if (baseContent && baseContent->HasAttr(kNameSpaceID_None, nsGkAtoms::editing))
       mScratchArray->AppendElement(nsGkAtoms::editing);
+
+    // multiple columns
+    if (mColumns->GetColumnAt(1))
+      mScratchArray->AppendElement(nsGkAtoms::multicol);
   }
 
   if (aCol) {
     mScratchArray->AppendElement(aCol->GetAtom());
 
     if (aCol->IsPrimary())
       mScratchArray->AppendElement(nsGkAtoms::primary);
 
--- a/toolkit/components/viewconfig/content/config.xul
+++ b/toolkit/components/viewconfig/content/config.xul
@@ -122,13 +122,13 @@
             class="sortDirectionIndicator"
             persist="hidden width ordinal sortDirection"/>
         <splitter class="tree-splitter" />
         <treecol id="valueCol" label="&valueColumn.label;" flex="10"
             class="sortDirectionIndicator"
             persist="hidden width ordinal sortDirection"/>
       </treecols>
 
-      <treechildren id="configTreeBody" alternatingbackground="true" ondblclick="if (event.button == 0) ModifySelected();"/>
+      <treechildren id="configTreeBody" ondblclick="if (event.button == 0) ModifySelected();"/>
     </tree>
   </vbox>
 </deck>
 </window>
--- a/toolkit/themes/gnomestripe/global/tree.css
+++ b/toolkit/themes/gnomestripe/global/tree.css
@@ -70,21 +70,26 @@ tree {
 /* ::::: tree rows ::::: */
 
 treechildren::-moz-tree-row {
   border: 1px solid transparent;
   min-height: 18px;
   height: 1.3em;
 }
 
+treechildren::-moz-tree-row(multicol, odd) {
+ background-color: -moz-oddtreerow;
+}
+
 treechildren::-moz-tree-row(selected) {
   background-color: -moz-cellhighlight;
 }
 
-treechildren::-moz-tree-row(selected, focus) {
+treechildren::-moz-tree-row(selected, focus),
+treechildren::-moz-tree-row(multicol, odd, selected, focus) {
   background-color: Highlight;
 }
 
 treechildren::-moz-tree-row(current, focus) {
   border: 1px dotted Highlight;
 }
 
 treechildren::-moz-tree-row(selected, current, focus) {
--- a/toolkit/themes/pinstripe/global/tree.css
+++ b/toolkit/themes/pinstripe/global/tree.css
@@ -60,29 +60,29 @@ tree {
 /* ::::: tree rows ::::: */
 
 treechildren::-moz-tree-row {
   border-top: 1px solid transparent;
   height: 18px;
   background-color: -moz-field;
 }
 
-tree:not([hidecolumnpicker="true"]) treechildren::-moz-tree-row(odd) {
+treechildren::-moz-tree-row(multicol, odd) {
  background-color: -moz-oddtreerow;
 }
 
 treechildren::-moz-tree-row(selected),
 treechildren::-moz-tree-row(odd, selected),
-tree:not([hidecolumnpicker="true"]) treechildren::-moz-tree-row(odd, selected) {
+treechildren::-moz-tree-row(multicol, odd, selected) {
   background-color: -moz-mac-secondaryhighlight;
 }
 
 treechildren::-moz-tree-row(selected, focus), 
 treechildren::-moz-tree-row(odd, selected, focus),
-tree:not([hidecolumnpicker="true"]) treechildren::-moz-tree-row(odd, selected, focus) {
+treechildren::-moz-tree-row(multicol, odd, selected, focus) {
   background-color: Highlight;
   color: HighlightText;
 }
 
 tree[seltype="cell"] > treechildren::-moz-tree-row,
 tree[seltype="text"] > treechildren::-moz-tree-row {
   border-top: none;
   background-color: transparent;