Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit d82f645

Browse files
authored
Merge pull request #144 from pulse-browser/including-downloads-in-sidebar
2 parents 0934c80 + 78f8630 commit d82f645

File tree

7 files changed

+83
-12
lines changed

7 files changed

+83
-12
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"package": "gluon package",
2323
"ff-version": "gluon ff-version",
2424
"licenseCheck": "gluon license-check",
25-
"gluon": "gluon"
25+
"gluon": "gluon",
26+
"reset": "gluon reset"
2627
}
2728
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc
2+
index f3134d5a9a01b7965eede5695def5afef4a66d6b..626fba18a7e9341731f6b71a98197695d63d7c6c 100644
3+
--- a/browser/base/content/browser-menubar.inc
4+
+++ b/browser/base/content/browser-menubar.inc
5+
@@ -153,6 +153,9 @@
6+
type="checkbox"
7+
class="sync-ui-item"
8+
oncommand="SidebarUI.toggle('viewTabsSidebar');" data-l10n-id="menu-view-synced-tabs-sidebar"/>
9+
+ <menuitem id="menu_downloadsSidebar"
10+
+ type="checkbox"
11+
+ oncommand="SidebarUI.toggle('viewDownloadsSidebar');" data-l10n-id="navbar-downloads"/>
12+
</menupopup>
13+
</menu>
14+
<menuseparator/>

src/browser/base/content/browser-sidebar-js.patch

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/base/content/browser-sidebar.js b/browser/base/content/browser-sidebar.js
2-
index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafcf1d66f5a 100644
2+
index f09e37fc42f7754f7f3687884ead25124c1b2076..e1833bbfd8a8ed7da767349f886d554f3dd795f3 100644
33
--- a/browser/base/content/browser-sidebar.js
44
+++ b/browser/base/content/browser-sidebar.js
55
@@ -11,6 +11,10 @@ var SidebarUI = {
@@ -37,11 +37,21 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
3737
}),
3838
],
3939
[
40-
@@ -47,8 +54,27 @@ var SidebarUI = {
40+
@@ -47,8 +54,37 @@ var SidebarUI = {
4141
elementId: "sidebar-switcher-tabs",
4242
url: "chrome://browser/content/syncedtabs/sidebar.xhtml",
4343
menuId: "menu_tabsSidebar",
4444
+ iconurl: "chrome://browser/skin/tab.svg",
45+
+ }),
46+
+ ],
47+
+ [
48+
+ "viewDownloadsSidebar",
49+
+ makeSidebar({
50+
+ elementId: "sidebar-switcher-downloads",
51+
+ title: "Downloads",
52+
+ url: "about:downloads",
53+
+ menuId: "menu_downloadsSidebar",
54+
+ iconurl: "chrome://browser/skin/downloads/downloads.svg"
4555
}),
4656
],
4757
+ [
@@ -65,7 +75,7 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
6575
]));
6676
},
6777

68-
@@ -61,6 +87,8 @@ var SidebarUI = {
78+
@@ -61,6 +97,8 @@ var SidebarUI = {
6979
return (this._browser = document.getElementById("sidebar"));
7080
},
7181
POSITION_START_PREF: "sidebar.position_start",
@@ -74,7 +84,7 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
7484
DEFAULT_SIDEBAR_ID: "viewBookmarksSidebar",
7585

7686
// lastOpenedId is set in show() but unlike currentID it's not cleared out on hide
77-
@@ -78,6 +106,8 @@ var SidebarUI = {
87+
@@ -78,6 +116,8 @@ var SidebarUI = {
7888
},
7989
_splitter: null,
8090
_icon: null,
@@ -83,7 +93,7 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
8393
_reversePositionButton: null,
8494
_switcherPanel: null,
8595
_switcherTarget: null,
86-
@@ -110,10 +140,40 @@ var SidebarUI = {
96+
@@ -110,10 +150,40 @@ var SidebarUI = {
8797
this._switcherTarget = document.getElementById("sidebar-switcher-target");
8898
this._switcherArrow = document.getElementById("sidebar-switcher-arrow");
8999

@@ -124,7 +134,7 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
124134
this._inited = true;
125135

126136
Services.obs.addObserver(this, "intl:app-locales-changed");
127-
@@ -159,17 +219,26 @@ var SidebarUI = {
137+
@@ -159,17 +229,26 @@ var SidebarUI = {
128138
/**
129139
* The handler for Services.obs.addObserver.
130140
**/
@@ -155,7 +165,7 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
155165
}
156166
}
157167
},
158-
@@ -573,6 +642,10 @@ var SidebarUI = {
168+
@@ -573,6 +652,10 @@ var SidebarUI = {
159169
this._box.setAttribute("sidebarcommand", commandID);
160170
this.lastOpenedId = commandID;
161171

@@ -166,7 +176,7 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
166176
let { url, title, sourceL10nEl } = this.sidebars.get(commandID);
167177
this.title = title;
168178
// Keep the title element in sync with any l10n changes.
169-
@@ -618,6 +691,26 @@ var SidebarUI = {
179+
@@ -618,6 +701,26 @@ var SidebarUI = {
170180

171181
this.selectMenuItem("");
172182

@@ -193,7 +203,7 @@ index f09e37fc42f7754f7f3687884ead25124c1b2076..3148bad1c6c65207064bd650eef9bafc
193203
// Replace the document currently displayed in the sidebar with about:blank
194204
// so that we can free memory by unloading the page. We need to explicitly
195205
// create a new content viewer because the old one doesn't get destroyed
196-
@@ -641,25 +734,112 @@ var SidebarUI = {
206+
@@ -641,25 +744,112 @@ var SidebarUI = {
197207
* none if the argument is an empty string.
198208
*/
199209
selectMenuItem(commandID) {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
/* ========================================================================== */
6+
/* about:downloads */
7+
8+
#contentAreaDownloadsView {
9+
background: var(--tab-selected-bgcolor, var(--toolbar-bgcolor));
10+
}
11+
12+
#downloadsListBox {
13+
border: none;
14+
border-radius: 0;
15+
background: none;
16+
}
17+
18+
#downloadsListBox > richlistitem {
19+
border-radius: 4px;
20+
transition: background-color 0.2s ease-in-out;
21+
22+
margin-bottom: 8px;
23+
}
24+
25+
#downloadsListBox > richlistitem:not([selected]):hover {
26+
background-color: var(--in-content-box-background);
27+
}
28+
29+
@media (prefers-reduced-motion) {
30+
#downloadsListBox > richlistitem {
31+
transition: none;
32+
}
33+
}

src/browser/themes/pulse/jar.inc.mn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
# be specified once. As a result, the source file paths are relative
88
# to the location of the actual manifest.
99

10-
* skin/classic/browser/sidebar_tabs.css (../pulse/sidebar_tabs.css)
10+
* skin/classic/browser/pulse/sidebar_tabs.css (../pulse/sidebar_tabs.css)
11+
skin/classic/browser/pulse/downloads.css (../pulse/content/downloads.css)
1112
skin/classic/browser/addons/shared.css (../pulse/addons/shared.css)

src/browser/themes/pulse/sidebar_tabs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
/* ========================================================================== */
6-
/* SIDE BAR STYLES */
6+
/* SIDEBAR TABS STYLES */
77

88
:root {
99
--sidebar-inside-padding: 8px;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/browser/themes/shared/downloads/allDownloadsView.inc.css b/browser/themes/shared/downloads/allDownloadsView.inc.css
2+
index 204e6a95a17a58789c5992983196542104f6cf84..43f7cae36b9b60d27d2442efe3f48f7cbea8bcaa 100644
3+
--- a/browser/themes/shared/downloads/allDownloadsView.inc.css
4+
+++ b/browser/themes/shared/downloads/allDownloadsView.inc.css
5+
@@ -4,6 +4,7 @@
6+
7+
@import "chrome://browser/skin/downloads/progressmeter.css";
8+
@import "chrome://browser/skin/downloads/download-blockedStates.css";
9+
+@import "chrome://browser/skin/pulse/downloads.css";
10+
11+
/*** View and outer controls ***/
12+

0 commit comments

Comments
 (0)