gecko-dev/browser/themes/shared/downloads/downloads.inc.css
Sean Lee 9b70990ee3 Bug 1269962 - Implement a popup menu for showing a submenu in Downloads Panel Footer., r=Paolo
MozReview-Commit-ID: 7K1W15039W8

--HG--
extra : rebase_source : 01b66909876cb22ea8442d037ebd8b8f3f5748ec
2016-07-13 13:39:00 +08:00

320 lines
8.7 KiB
CSS

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%filter substitution
%define keyfocus #downloadsPanel[keyfocus]
%define notKeyfocus #downloadsPanel:not([keyfocus])
%define item richlistitem[type="download"]
%define itemFinished @item@[state="1"]
%define itemNotFinished @item@:not([state="1"])
%define itemFocused #downloadsListBox:focus > @item@[selected]
/*** Panel and outer controls ***/
#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent {
overflow: hidden;
display: block;
}
#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent,
#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack > .panel-subviews {
padding: 0;
}
#downloadsListBox {
background: transparent;
padding: 4px;
color: inherit;
}
#emptyDownloads {
padding: 16px 25px;
margin: 0;
/* The panel can be wider than this description after the blocked subview is
shown, so center the text. */
text-align: center;
}
.downloadsPanelFooter {
background-color: hsla(210,4%,10%,.07);
border-top: 1px solid var(--panel-separator-color);
}
.downloadsPanelFooter toolbarseparator {
margin: 0;
border: 0;
min-width: 0;
border-left: 1px solid var(--panel-separator-color);
-moz-appearance: none;
}
.downloadsPanelFooterButton {
-moz-appearance: none;
background-color: transparent;
color: inherit;
margin: 0;
padding: 0;
min-width: 0;
min-height: 40px;
}
.downloadsPanelFooterButton:hover {
outline: 1px solid hsla(210,4%,10%,.07);
background-color: hsla(210,4%,10%,.07);
}
.downloadsPanelFooterButton:hover:active,
.downloadsPanelFooterButton[open="true"] {
outline: 1px solid hsla(210,4%,10%,.12);
background-color: hsla(210,4%,10%,.12);
box-shadow: 0 1px 0 hsla(210,4%,10%,.05) inset;
}
.downloadsPanelFooterButton[default] {
background-color: #0996f8;
color: white;
}
.downloadsPanelFooterButton[default]:hover {
background-color: #0675d3;
}
.downloadsPanelFooterButton[default]:hover:active {
background-color: #0568ba;
}
#downloadsPanel[hasdownloads] #downloadsHistory {
padding-left: 58px !important;
}
toolbarseparator.downloadsDropmarkerSplitter {
margin: 7px 0;
}
#downloadsFooter:hover toolbarseparator.downloadsDropmarkerSplitter,
#downloadsFooter toolbarseparator.downloadsDropmarkerSplitterExtend {
margin: 0;
}
.downloadsDropmarker {
padding: 0 19px !important;
}
.downloadsDropmarker > .button-box > hbox {
display: none;
}
.downloadsDropmarker > .button-box > .button-menu-dropmarker {
/* This is to override the linux !important */
-moz-appearance: none !important;
display: -moz-box;
}
.downloadsDropmarker > .button-box > .button-menu-dropmarker > .dropmarker-icon {
width: 16px;
height: 16px;
list-style-image: url("chrome://browser/skin/downloads/menubutton-dropmarker.svg");
filter: url("chrome://browser/skin/filters.svg#fill");
fill: currentColor;
}
/* Override default icon size which is too small for this dropdown */
.downloadsDropmarker > .button-box > .button-menu-dropmarker {
width: 16px;
height: 16px;
}
#downloadsSummary {
--summary-padding-end: 38px;
--summary-padding-start: 12px;
padding: 8px var(--summary-padding-end) 8px var(--summary-padding-start);
cursor: pointer;
-moz-user-focus: normal;
}
#downloadsSummary:-moz-locale-dir(rtl) {
padding-right: var(--summary-padding-start);
padding-left: var(--summary-padding-end);
}
#downloadsSummaryChildBox {
-moz-margin-start: var(--summary-padding-start);
-moz-margin-end: var(--summary-padding-end);
}
#downloadsSummary > .downloadTypeIcon {
list-style-image: url("chrome://browser/skin/downloads/download-summary.png");
}
%ifdef XP_MACOSX
@media (min-resolution: 2dppx) {
#downloadsSummary > .downloadTypeIcon {
list-style-image: url("chrome://browser/skin/downloads/download-summary@2x.png");
}
}
%endif
#downloadsSummaryDescription {
color: -moz-nativehyperlinktext;
}
/*** List items and similar elements in the summary ***/
#downloadsSummary,
richlistitem[type="download"] {
height: var(--downloads-item-height);
padding-inline-end: 0;
color: inherit;
}
richlistitem[type="download"] {
margin: 0;
border-top: 1px solid var(--downloads-item-border-top-color);
border-bottom: 1px solid var(--downloads-item-border-bottom-color);
background: transparent;
padding: 8px;
}
richlistitem[type="download"]:first-child {
border-top: 1px solid transparent;
}
richlistitem[type="download"]:last-child {
border-bottom: 1px solid transparent;
}
.downloadTypeIcon {
--inline-offset: 8px;
--block-offset: 4px;
--icon-size: 32px;
}
.downloadTypeIcon {
margin-inline-end: 8px;
/* Prevent flickering when changing states. */
width: calc(var(--icon-size) + var(--inline-offset));
height: calc(var(--icon-size) + var(--block-offset));
padding: var(--block-offset) var(--inline-offset) 0 0;
}
.blockedIcon {
--overlay-image-dimensions: top right / 16px no-repeat;
padding: 0;
background: url("chrome://browser/skin/downloads/download-blocked.svg") var(--overlay-image-dimensions);
}
@item@[verdict="PotentiallyUnwanted"] .blockedIcon {
background: url("chrome://browser/skin/warning.svg") var(--overlay-image-dimensions);
}
@item@[verdict="Uncommon"] .blockedIcon {
background: url("chrome://browser/skin/info.svg") var(--overlay-image-dimensions);
}
/* We hold .downloadTarget, .downloadProgress and .downloadDetails inside of
a vbox with class .downloadContainer. We set the font-size of the entire
container to --downloads-item-font-size-factor because:
1) This is the size that we want .downloadDetails to be
2) The container's width is set by localizers by &downloadDetails.width;,
which is a ch unit. Since this is the value that should control the
panel width, we apply it to the outer container to constrain
.downloadTarget and .downloadProgress.
Finally, since we want .downloadTarget's font-size to be at 100% of the
font-size of .downloadContainer's parent, we use calc to go from the
smaller font-size back to the original font-size.
*/
#downloadsSummaryDetails,
.downloadContainer {
font-size: calc(100% * var(--downloads-item-font-size-factor));
}
#downloadsSummaryDescription,
.downloadTarget {
margin-bottom: var(--downloads-item-target-margin-bottom);
cursor: inherit;
}
.downloadTarget {
font-size: calc(100% / var(--downloads-item-font-size-factor));
}
#downloadsSummaryDetails,
.downloadDetails {
margin-top: var(--downloads-item-details-margin-top);
opacity: var(--downloads-item-details-opacity);
cursor: inherit;
}
.downloadButton {
-moz-appearance: none;
min-width: 0;
min-height: 0;
margin: 3px;
border: none;
background: transparent;
padding: 5px;
list-style-image: url("chrome://browser/skin/downloads/buttons.png");
}
.downloadButton > .button-box {
padding: 0;
}
/*** Blocked subview ***/
#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype=main] > .panel-subviews {
/* When the main view is showing, the shadow on the left edge of the subview is
barely visible on the right edge of the main view, so set it to none. */
box-shadow: none;
}
/* When the subview is showing, turn the download button into an arrow pointing
back to the main view. */
#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] .download-state[showingsubview] .downloadButton {
list-style-image: url("chrome://browser/skin/customizableui/subView-arrow-back-inverted.png");
}
#downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] .download-state[showingsubview] .downloadButton:-moz-locale-dir(rtl) {
list-style-image: url("chrome://browser/skin/customizableui/subView-arrow-back-inverted-rtl.png");
}
#downloadsPanel-blockedSubview {
background-image: url("chrome://browser/skin/warning.svg");
background-size: 32px 32px;
background-position: 16px 16px;
background-repeat: no-repeat;
}
#downloadsPanel-blockedSubview:-moz-locale-dir(rtl) {
background-position: calc(100% - 16px) 16px;
}
#downloadsPanel-blockedSubview[verdict=Malware] {
background-image: url("chrome://browser/skin/downloads/download-blocked.svg");
}
#downloadsPanel-blockedSubview-title {
margin-top: 16px;
margin-bottom: 16px;
font-size: calc(100% / var(--downloads-item-font-size-factor));
}
#downloadsPanel-blockedSubview-details1,
#downloadsPanel-blockedSubview-details2 {
font-size: calc(100% * var(--downloads-item-font-size-factor));
margin-bottom: 16px;
opacity: var(--downloads-item-details-opacity);
}
#downloadsPanel-blockedSubview-title,
#downloadsPanel-blockedSubview-details1,
#downloadsPanel-blockedSubview-details2 {
-moz-margin-start: 64px;
-moz-margin-end: 16px;
}