mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 18:51:28 +00:00
Bug 401215 - "Background banding for the download manager" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r=sdwilsh aM9=beltzner]
This commit is contained in:
parent
4894cad90d
commit
69595574d6
@ -161,9 +161,10 @@ function downloadCompleted(aDownload)
|
||||
|
||||
// If we are displaying search results, we do not want to add it to the list
|
||||
// of completed downloads
|
||||
if (!gSearching)
|
||||
if (!gSearching) {
|
||||
gDownloadsView.insertBefore(dl, gDownloadsDoneArea.nextSibling);
|
||||
else
|
||||
evenOddCellAttribution();
|
||||
} else
|
||||
removeFromView(dl);
|
||||
|
||||
// getTypeFromFile fails if it can't find a type for this file.
|
||||
@ -848,6 +849,7 @@ function removeFromView(aDownload)
|
||||
let index = gDownloadsView.selectedIndex;
|
||||
gDownloadsView.removeChild(aDownload);
|
||||
gDownloadsView.selectedIndex = Math.min(index, gDownloadsView.itemCount - 1);
|
||||
evenOddCellAttribution();
|
||||
}
|
||||
|
||||
function getReferrerOrSource(aDownload)
|
||||
@ -878,6 +880,25 @@ function buildDefaultView()
|
||||
gDownloadsView.selectedItem = children[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives every second cell an odd attribute so they can receive alternating
|
||||
* backgrounds from the stylesheets.
|
||||
*/
|
||||
function evenOddCellAttribution()
|
||||
{
|
||||
let alternateCell = false;
|
||||
let allDownloadsInView = gDownloadsView.getElementsByTagName("richlistitem");
|
||||
|
||||
for (let i = 0; i < allDownloadsInView.length; i++) {
|
||||
if (alternateCell)
|
||||
allDownloadsInView[i].setAttribute("alternate", "true");
|
||||
else
|
||||
allDownloadsInView[i].removeAttribute("alternate");
|
||||
|
||||
alternateCell = !alternateCell;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the downloads list with a given statement and reference node.
|
||||
*
|
||||
@ -923,6 +944,7 @@ function buildDownloadList(aStmt, aRef)
|
||||
if (dl)
|
||||
gDownloadsView.insertBefore(dl, aRef.nextSibling);
|
||||
}
|
||||
evenOddCellAttribution();
|
||||
}
|
||||
|
||||
var gActiveDownloadsQuery = null;
|
||||
|
@ -10,6 +10,10 @@ richlistitem[type="download"] {
|
||||
min-height: 46px !important;
|
||||
}
|
||||
|
||||
richlistitem[type="download"][alternate="true"]:not([selected="true"]) {
|
||||
background-color: #ecf2fe;
|
||||
}
|
||||
|
||||
richlistitem[type="download"] .name {
|
||||
font-size: larger;
|
||||
}
|
||||
|
@ -16,6 +16,10 @@ richlistitem[type="download"] {
|
||||
min-height: 46px;
|
||||
}
|
||||
|
||||
richlistitem[type="download"][alternate="true"]:not([selected="true"]) {
|
||||
background-color: ThreeDLightShadow;
|
||||
}
|
||||
|
||||
richlistitem[type="download"] .name {
|
||||
font-size: larger;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user