From fff59923b43823f038acab38fc3cd554de9a061f Mon Sep 17 00:00:00 2001 From: Blake Winton Date: Tue, 1 Aug 2017 09:18:11 -0400 Subject: [PATCH] Bug 1384692 - Update the download doorhanger style. ui-r=amylee, r=Paolo. MozReview-Commit-ID: 4pY9JxnLNYk --HG-- extra : rebase_source : a6573e33298e84fca2fc8de92c932f770dcc53b2 --- .../downloads/content/downloads.css | 60 ------------------- .../components/downloads/content/downloads.js | 26 ++------ .../downloads/content/downloadsOverlay.xul | 10 ++-- .../chrome/browser/downloads/downloads.dtd | 6 ++ .../themes/shared/downloads/downloads.inc.css | 34 +---------- 5 files changed, 21 insertions(+), 115 deletions(-) diff --git a/browser/components/downloads/content/downloads.css b/browser/components/downloads/content/downloads.css index 7f05ffa47459..0a945e7ffcdb 100644 --- a/browser/components/downloads/content/downloads.css +++ b/browser/components/downloads/content/downloads.css @@ -200,63 +200,3 @@ richlistitem.download button { #downloadsPanel-mainView .download-state[state="8"] .downloadShowBlockedInfo { display: inline; } - -/** When the main view is showing... **/ - -/* The subview should be off to the right and not visible at all. */ -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype=main] > .panel-subviews { - transform: translateX(101%); - transition: transform var(--panelui-subview-transition-duration); -} - -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype=main] > .panel-subviews:-moz-locale-dir(rtl) { - transform: translateX(-101%); -} - -/** When the subview is showing... **/ - -/* Hide the buttons of all downloads except the one that triggered the - subview. */ -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] .download-state:not([showingsubview]) .downloadButton { - visibility: hidden; -} - -/* For the download that triggered the subview, move its button farther to the - right by removing padding so that a minimum amount of the main view's right - edge needs to be shown. */ -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] .download-state[showingsubview] { - padding: 0; -} - -/* The main view should slide to the left and its right edge should remain - visible. */ -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype=subview] > .panel-mainview { - transform: translateX(calc(-100% + 38px)); - transition: transform var(--panelui-subview-transition-duration); -} - -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype=subview] > .panel-mainview:-moz-locale-dir(rtl) { - transform: translateX(calc(100% - 38px)); -} - -/* The subview should leave the right edge of the main view uncovered. */ -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack > .panel-subviews { - /* Use a margin instead of a transform like above so that the subview's width - isn't wider than the panel. */ - -moz-margin-start: 38px !important; -} - -/* Prevent keyboard interaction in the main view by preventing all elements in - the main view from being focused... */ -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] > .panel-mainview #downloadsListBox, -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] > .panel-mainview richlistitem, -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] > .panel-mainview .downloadButton, -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] > .panel-mainview .downloadsPanelFooterButton, -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] > .panel-mainview #downloadsSummary { - -moz-user-focus: ignore; -} -/* ... except for the downloadShowBlockedInfo button in the blocked download. - Selecting it with the keyboard should show the main view again. */ -#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] .download-state[showingsubview] .downloadShowBlockedInfo { - -moz-user-focus: normal; -} diff --git a/browser/components/downloads/content/downloads.js b/browser/components/downloads/content/downloads.js index 506365b60067..d8982f5e7559 100644 --- a/browser/components/downloads/content/downloads.js +++ b/browser/components/downloads/content/downloads.js @@ -1571,13 +1571,6 @@ var DownloadsBlockedSubview = { * An array of strings with information about the block. */ toggle(element, title, details) { - if (this.view.showingSubView) { - this.hide(); - return; - } - - this.element = element; - element.setAttribute("showingsubview", "true"); DownloadsView.subViewOpen = true; DownloadsViewController.updateCommands(); @@ -1598,16 +1591,19 @@ var DownloadsBlockedSubview = { // Without this, the mainView is more narrow than the panel once all // downloads are removed from the panel. document.getElementById("downloadsPanel-mainView").style.minWidth = - window.getComputedStyle(this.view).width; + window.getComputedStyle(this.subview).width; }, handleEvent(event) { switch (event.type) { case "ViewHiding": this.subview.removeEventListener(event.type, this); - this.element.removeAttribute("showingsubview"); DownloadsView.subViewOpen = false; - delete this.element; + // If we're going back to the main panel, use showPanel to + // focus the proper element. + if (this.view.current !== this.subview) { + DownloadsPanel.showPanel(); + } break; default: DownloadsCommon.log("Unhandled DownloadsBlockedSubview event: " + @@ -1616,16 +1612,6 @@ var DownloadsBlockedSubview = { } }, - /** - * Slides out the blocked subview and shows the main view. - */ - hide() { - this.view.showMainView(); - // The point of this is to focus the proper element in the panel now that - // the main view is showing again. showPanel handles that. - DownloadsPanel.showPanel(); - }, - /** * Deletes the download and hides the entire panel. */ diff --git a/browser/components/downloads/content/downloadsOverlay.xul b/browser/components/downloads/content/downloadsOverlay.xul index 8f25d2718de6..d481d8c65333 100644 --- a/browser/components/downloads/content/downloadsOverlay.xul +++ b/browser/components/downloads/content/downloadsOverlay.xul @@ -106,8 +106,8 @@ accesskey="&cmd.clearList2.accesskey;"/> - + @@ -154,7 +154,9 @@ + descriptionheightworkaround="true" + class="PanelUI-subView" + title="&downloadDetails.label;"> @@ -176,7 +178,7 @@ - + diff --git a/browser/locales/en-US/chrome/browser/downloads/downloads.dtd b/browser/locales/en-US/chrome/browser/downloads/downloads.dtd index c077455d6b33..007b5e801ad5 100644 --- a/browser/locales/en-US/chrome/browser/downloads/downloads.dtd +++ b/browser/locales/en-US/chrome/browser/downloads/downloads.dtd @@ -134,6 +134,12 @@ + + +