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

Commit fec3ed4

Browse files
authored
πŸ”€ Redesign the UI (#68)
2 parents 62779d2 + e36832d commit fec3ed4

File tree

7 files changed

+193
-23
lines changed

7 files changed

+193
-23
lines changed

β€Žsrc/browser/base/content/browser-sidebar-js.patchβ€Ž

Lines changed: 49 additions & 2 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 eb1ee9e2b868fa06af4ed88e1d54583cd4196880..faa86a8037a36652e8507d631354e11a7852db07 100644
2+
index eb1ee9e2b868fa06af4ed88e1d54583cd4196880..4a4f2e926d2954003cd4b8cbacc318dc820f8cc8 100644
33
--- a/browser/base/content/browser-sidebar.js
44
+++ b/browser/base/content/browser-sidebar.js
55
@@ -2,10 +2,14 @@
@@ -179,7 +179,54 @@ index eb1ee9e2b868fa06af4ed88e1d54583cd4196880..faa86a8037a36652e8507d631354e11a
179179
/**
180180
* Opens the switcher panel if it's closed, or closes it if it's open.
181181
*/
182-
@@ -575,21 +681,31 @@ var SidebarUI = {
182+
@@ -457,6 +563,10 @@ var SidebarUI = {
183+
return this._show(commandID).then(() => {
184+
this._loadSidebarExtension(commandID);
185+
186+
+ // Pulse: Reset sidebar margin to zero to allow for correct animations to
187+
+ // take place (adapted from dot browser, se below)
188+
+ this._box.style.marginLeft = '0px'
189+
+
190+
if (triggerNode) {
191+
updateToggleControlLabel(triggerNode);
192+
}
193+
@@ -552,6 +662,25 @@ var SidebarUI = {
194+
195+
this.selectMenuItem("");
196+
197+
+ // The below code was, in part, based on Dot Browser's source code
198+
+ // https://github.com/dothq/browser-desktop/blob/3c6b992af8946e1c30180cc824a78d4bb85ba868/patches/browser-base-content-browser-sidebar-js.patch#L183
199+
+
200+
+ // Pulse Browser: Helper stuff for sidebar animation. We can fake sliding in
201+
+ // and out by changing the left margin to be a negative value. Then, inside
202+
+ // of our css code, we can animate it to close.
203+
+ this._box.style.marginLeft = `${-Math.abs(this._box.getBoundingClientRect().width)}px`
204+
+
205+
+ // We want to fully set it to hidden to slightly improve browser performance
206+
+ // when it is hidden. Note that this replaces some of Mozilla's code that
207+
+ // would generally be down below
208+
+ setTimeout(() => {
209+
+ this._box.hidden = true
210+
+ this._splitter.hidden = true
211+
+
212+
+ this._box.removeAttribute("checked")
213+
+ }, 170);
214+
+
215+
+
216+
// Replace the document currently displayed in the sidebar with about:blank
217+
// so that we can free memory by unloading the page. We need to explicitly
218+
// create a new content viewer because the old one doesn't get destroyed
219+
@@ -560,9 +689,6 @@ var SidebarUI = {
220+
this.browser.setAttribute("src", "about:blank");
221+
this.browser.docShell.createAboutBlankContentViewer(null, null);
222+
223+
- this._box.removeAttribute("checked");
224+
- this._box.hidden = this._splitter.hidden = true;
225+
-
226+
let selBrowser = gBrowser.selectedBrowser;
227+
selBrowser.focus();
228+
if (triggerNode) {
229+
@@ -575,21 +701,31 @@ var SidebarUI = {
183230
* none if the argument is an empty string.
184231
*/
185232
selectMenuItem(commandID) {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/browser/extensions/tabliss/manifest.json b/browser/extensions/tabliss/manifest.json
2+
index b22be5737d450e9f7fa2c55dac44432505e293f4..2e6fc77ad046544fb3dda676ff29323326458f06 100644
3+
--- a/browser/extensions/tabliss/manifest.json
4+
+++ b/browser/extensions/tabliss/manifest.json
5+
@@ -13,6 +13,10 @@
6+
"chrome_url_overrides": {
7+
"newtab": "index.html"
8+
},
9+
+ "chrome_settings_overrides": {
10+
+ // Pulse: We want tabliss to appear on the home screen as well as new tabpages
11+
+ "homepage": "index.html"
12+
+ },
13+
"icons": {
14+
"32": "icons/32.png",
15+
"48": "icons/48.png",

β€Žsrc/browser/themes/addons/shared/shared.inc.cssβ€Ž

Lines changed: 103 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
99
%include ./macos.inc.css
1010
%endif
1111

12+
/* Pulse specific variables */
13+
:root {
14+
--tab-rounding-size: 8px;
15+
--tab-rounding-size-neg: -8px;
16+
}
17+
18+
1219
:root {
1320
/* Colors */
1421
--gradient-orientation: 90deg;
@@ -22,25 +29,23 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
2229
--tab-block-margin: 0 !important; /* The padding around each tab. In proton, this is what makes them float */
2330
--tab-border-radius: 0 !important; /* The border radius of the tab */
2431
--tab-padding-inline: 0 !important; /* Padding to the left and right of the tab. **Focus Browser custom** */
32+
33+
--toolbarbutton-border-radius: 4px;
2534

2635
/* Toolbar area */
2736
--toolbar-field-border-color: transparent !important; /* The border color of the search input */
28-
--toolbarbutton-border-radius: 0 !important; /* The border radius of the search input */
29-
--urlbar-icon-border-radius: 0 !important; /* The border radius of the identity box icon */
3037

3138
/* App Menu styling */
32-
--arrowpanel-menuitem-border-radius: 0 !important; /* The border radius of the app menu items */
33-
--arrowpanel-border-radius: 0 !important; /* The border radius of the app menu */
3439
--panel-separator-zap-gradient: var(
3540
--gradient
3641
) !important; /* The gradient used for the app menu separator */
3742

3843
/* Panel variables */
39-
--panel-footer-item-border-radius: 0; /* The border radius of the panel footer items */
44+
--panel-footer-item-border-radius: 8px; /* The border radius of the panel footer items */
4045

4146
/* Bookmark panel */
42-
--bookmark-panel-image-border-radius: 0; /* The border radius of the bookmark panel image */
43-
--bookmark-panel-favicon-border-radius: 0; /* The border radius of the bookmark panel favicon */
47+
--bookmark-panel-image-border-radius: 8px; /* The border radius of the bookmark panel image */
48+
--bookmark-panel-favicon-border-radius: 8px; /* The border radius of the bookmark panel favicon */
4449
--bookmark-panel-menulist-padding: 5px;
4550
--bookmark-panel-input-border-radius: 0; /* The border radius of the bookmark panel input */
4651
--bookmark-panel-border-radius: var(
@@ -50,33 +55,118 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
5055
/* Custom elements */
5156

5257
/* Menulist */
53-
--menulist-border-radius: 0; /* The border radius of the menulist */
58+
--menulist-border-radius: 8px; /* The border radius of the menulist */
5459

5560
/* Dialog variables */
56-
--dialog-border-radius: 0; /* The border radius of the dialog */
61+
--dialog-border-radius: 8px; /* The border radius of the dialog */
5762

5863
/* Make the tabs a touch wider */
59-
--tab-min-height: 40px;
64+
--tab-min-height: 38px;
65+
}
66+
67+
#tabs-newtab-button .toolbarbutton-icon {
68+
width: 24px;
69+
height: 24px;
70+
margin-left: 8px;
71+
padding: 4px !important;
72+
}
73+
74+
.toolbarbutton-icon, .tab-close-button {
75+
border-radius: 4px !important;
6076
}
6177

6278
.container.infobar::before {
6379
--gradient-orientation: 0;
6480
background-image: var(--gradient) !important;
6581
}
6682

83+
/* ========================================================================== */
84+
/* Tab style */
85+
86+
/* BUG GH#54: The container color does not show up in the pulse theme */
87+
.tabbrowser-tab {
88+
border-top: 2px solid var(--identity-tab-color);
89+
}
90+
91+
.tab-background[selected="true"]::before, .tab-background[selected="true"]::after {
92+
content: "";
93+
position: absolute;
94+
bottom: 0;
95+
96+
background-size: cover;
97+
color: var(--lwt-selected-tab-background-color);
98+
-moz-context-properties: fill, fill-opacity;
99+
fill: currentColor;
100+
101+
width: var(--tab-rounding-size);
102+
height: var(--tab-rounding-size);
103+
}
104+
105+
.tab-background[selected="true"]::before {
106+
background-image: url("chrome://global/skin/icons/tab-rising-edge.svg");
107+
left: var(--tab-rounding-size-neg);
108+
}
109+
110+
.tab-background[selected="true"]::after {
111+
background-image: url("chrome://global/skin/icons/tab-falling-edge.svg");
112+
right: var(--tab-rounding-size-neg);
113+
}
114+
67115
#tabbrowser-arrowscrollbox .tabbrowser-tab {
68116
/* Specifies the padding to the left and right of the tab */
69117
padding-inline: var(--tab-padding-inline) !important;
70118
}
71119

120+
/* ========================================================================== */
121+
/* Sidebar tabs */
122+
.sidebar-item-background[checked="true"]::before, .sidebar-item-background[checked="true"]::after {
123+
content: "";
124+
position: absolute;
125+
right: 0;
126+
127+
background-size: cover;
128+
color: var(--lwt-selected-tab-background-color);
129+
-moz-context-properties: fill, fill-opacity;
130+
fill: currentColor;
131+
132+
width: var(--tab-rounding-size);
133+
height: var(--tab-rounding-size);
134+
135+
/* HACK: Stops the hoverstate from the next tab over from intersecting with the current tab */
136+
z-index: 10;
137+
}
138+
139+
.sidebar-item-background[checked="true"]::before {
140+
background-image: url("chrome://global/skin/icons/tab-rising-edge.svg");
141+
top: var(--tab-rounding-size-neg);
142+
}
143+
144+
.sidebar-item-background[checked="true"]::after {
145+
background-image: url("chrome://global/skin/icons/tab-falling-edge.svg");
146+
bottom: var(--tab-rounding-size-neg);
147+
transform: rotate(180deg);
148+
}
149+
150+
/* =========================================================================- */
151+
/* General sidebar stuff */
152+
.sidebar-splitter {
153+
border-style: none;
154+
}
155+
72156
/* Panel footer styles */
73157
.panel-footer > button {
74158
/* The border radius of the panel footer items */
75159
border-radius: var(--panel-footer-item-border-radius);
76160
}
77161

162+
/* ========================================================================== */
78163
/* Bookmark styles */
79164

165+
/* Remove messy seperators */
166+
#editBookmarkHeaderSeparator, #editBookmarkSeparator {
167+
display: none;
168+
}
169+
80170
#editBookmarkPanelImage {
81171
/* The border radius of the bookmark panel image */
82172
border-radius: var(--bookmark-panel-image-border-radius) !important;
@@ -122,11 +212,7 @@ menulist:host(:not([native])) {
122212
* If you have any issues with this style, please open a ticket at https://github.com/NiklasGollenstede/unload-tabs
123213
*/
124214

125-
@-moz-document url(chrome://browser/content/browser.xhtml),
126-
url(chrome://browser/content/browser.xul)
127-
{
128-
tab[pending],
129-
#alltabs-popup menuitem[pending] {
130-
opacity: 0.6 !important;
131-
}
215+
tab[pending],
216+
#alltabs-popup menuitem[pending] {
217+
opacity: 0.6 !important;
132218
}

β€Žsrc/browser/themes/shared/sidebar_tabs.inc.cssβ€Ž

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
display: flex;
1212
flex-direction: column;
1313
justify-content: space-between;
14-
background-color: var(--toolbar-bgcolor);
14+
background-color: var(--lwt-accent-color-inactive, var(--lwt-accent-color));
1515
overflow: hidden;
16+
17+
max-width: var(--tab-min-height);
18+
min-width: var(--tab-min-height);
19+
20+
/* Makes the sidebar slide out from below */
21+
position: relative;
22+
z-index: 10;
1623
}
1724

1825
.sidebar-icon-item {
@@ -40,6 +47,8 @@
4047
display: flex;
4148
justify-content: center;
4249
align-items: center;
50+
51+
position: relative;
4352
}
4453

4554
.sidebar-item-background:hover {
@@ -78,6 +87,11 @@
7887
-moz-font-smoothing-background-color: auto !important;
7988
}
8089

90+
/* Make it slide in smoothy rather than just appearing */
91+
#sidebar-box {
92+
transition: margin-left 200ms ease-in-out;
93+
}
94+
8195
/* Make it feel native on macos */
8296
%ifdef XP_MACOSX
8397
#sidebar-container:not([lwt-sidebar]) {
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
diff --git a/toolkit/themes/shared/desktop-jar.inc.mn b/toolkit/themes/shared/desktop-jar.inc.mn
2-
index 8658ca96084856eeeb58640de81d4e543f57c6d8..fb2893170cbda0e077714f5cd1e3dafa813ce02c 100644
2+
index 8658ca96084856eeeb58640de81d4e543f57c6d8..9977930b6ee0479796fd27fdec3ee12075bbc06a 100644
33
--- a/toolkit/themes/shared/desktop-jar.inc.mn
44
+++ b/toolkit/themes/shared/desktop-jar.inc.mn
5-
@@ -131,4 +131,5 @@
5+
@@ -131,4 +131,7 @@
66
skin/classic/global/reader/RM-Content-Width-Plus-44x16.svg (../../shared/reader/RM-Content-Width-Plus-44x16.svg)
77
skin/classic/global/reader/RM-Line-Height-Minus-38x14.svg (../../shared/reader/RM-Line-Height-Minus-38x14.svg)
88
skin/classic/global/reader/RM-Line-Height-Plus-38x24.svg (../../shared/reader/RM-Line-Height-Plus-38x24.svg)
9-
+ skin/classic/global/icons/bookmark-outline.svg (../../shared/icons/bookmark-outline.svg)
9+
+ skin/classic/global/icons/bookmark-outline.svg (../../shared/icons/bookmark-outline.svg)
10+
+ skin/classic/global/icons/tab-rising-edge.svg (../../shared/icons/tab-rising-edge.svg)
11+
+ skin/classic/global/icons/tab-falling-edge.svg (../../shared/icons/tab-falling-edge.svg)
1012

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
Β (0)