Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into feature/disable-dblc…
Browse files Browse the repository at this point in the history
…lick-new-tab
  • Loading branch information
vintydong committed Dec 16, 2024
2 parents 3f324e6 + 8f9d2df commit b8d97a5
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 51 deletions.
19 changes: 0 additions & 19 deletions src/browser/app/profile/better-fox.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ pref("browser.privatebrowsing.vpnpromourl", "", locked);
pref("extensions.getAddons.showPane", false);
pref("extensions.htmlaboutaddons.recommendations.enabled", false);
pref("browser.discovery.enabled", false);
pref("browser.shell.checkDefaultBrowser", false);
pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false);
pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false);
pref("browser.preferences.moreFromMozilla", false);
pref("browser.aboutConfig.showWarning", false);
pref("browser.aboutwelcome.enabled", false);

/** THEME ADJUSTMENTS ***/
Expand Down Expand Up @@ -179,20 +177,3 @@ pref("browser.bookmarks.openInTabClosesMenu", false);
pref("browser.menu.showViewImageInfo", true);
pref("findbar.highlightAll", true);
pref("layout.word_select.eat_space_to_next_word", false);

/****************************************************************************
* START: MY OVERRIDES *
****************************************************************************/
// visit https://github.com/yokoffing/Betterfox/wiki/Common-Overrides
// visit https://github.com/yokoffing/Betterfox/wiki/Optional-Hardening
// Enter your personal overrides below this line:

/****************************************************************************
* SECTION: SMOOTHFOX *
****************************************************************************/
// visit https://github.com/yokoffing/Betterfox/blob/main/Smoothfox.js
// Enter your scrolling overrides below this line:

/****************************************************************************
* END: BETTERFOX *
****************************************************************************/
12 changes: 8 additions & 4 deletions src/browser/base/content/ZenUIManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ var gZenVerticalTabsManager = {

_preCustomize() {
this._updateEvent({ forceMultipleToolbar: true });
this.navigatorToolbox.setAttribute('zen-sidebar-expanded', 'true');
document.documentElement.setAttribute('zen-sidebar-expanded', 'true'); // force expanded sidebar
},

initializePreferences(updateEvent) {
Expand Down Expand Up @@ -298,9 +300,7 @@ var gZenVerticalTabsManager = {
let shouldHide = false;
if (((!isRightSide && this.isWindowsStyledButtons) || (isRightSide && !this.isWindowsStyledButtons)
|| (
isCompactMode && isSingleToolbar && !(
(!this.isWindowsStyledButtons && !isRightSide)
)
isCompactMode && isSingleToolbar && this.isWindowsStyledButtons && !isRightSide
)) && isSingleToolbar) {
appContentNavbarContaienr.setAttribute('should-hide', 'true');
shouldHide = true;
Expand Down Expand Up @@ -382,6 +382,10 @@ var gZenVerticalTabsManager = {
if (!doNotChangeWindowButtons && isSingleToolbar && !isCompactMode && !isRightSide && !this.isWindowsStyledButtons) {
topButtons.prepend(windowButtons);
}
// Case: single toolbar, compact mode, right side and windows styled buttons
if (isSingleToolbar && isCompactMode && isRightSide && this.isWindowsStyledButtons) {
topButtons.prepend(windowButtons);
}

if (doNotChangeWindowButtons) {
if (isRightSide && !isSidebarExpanded) {
Expand Down Expand Up @@ -411,7 +415,7 @@ var gZenVerticalTabsManager = {
}
}

if (shouldHide) {
if (shouldHide && !isCompactMode) {
appContentNavbarContaienr.append(windowButtons);
}

Expand Down
9 changes: 8 additions & 1 deletion src/browser/base/content/zen-styles/zen-browser-ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,20 @@
:root:not([inDOMFullscreen='true']):not([chromehidden~='location']):not([chromehidden~='toolbar']) {
& #zen-tabbox-wrapper {
margin: var(--zen-element-separation);
margin-left: 0;
margin-top: 0;
}

&:not([zen-right-side='true']) #zen-tabbox-wrapper {
margin-left: 0;
}

&[zen-right-side='true'] #zen-tabbox-wrapper {
margin-right: 0;
}

&:not([zen-no-padding='true']) #zen-tabbox-wrapper {
margin-left: 1px;
}
}

#tabbrowser-tabbox {
Expand Down
11 changes: 10 additions & 1 deletion src/browser/base/content/zen-styles/zen-compact-mode.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
pointer-events: none;
}

@media (-moz-bool-pref: 'zen.view.compact.hide-tabbar') {
@media (-moz-bool-pref: 'zen.view.compact.hide-tabbar') or (-moz-bool-pref: 'zen.view.use-single-toolbar') {
#zen-sidebar-web-panel-wrapper:has(#zen-sidebar-web-panel[pinned='true']) {
margin-left: calc(var(--zen-sidebar-web-panel-spacing) * 2) !important;
}
Expand Down Expand Up @@ -133,6 +133,10 @@
margin-top: var(--zen-element-separation) !important;
}

& #zen-appcontent-wrapper {
z-index: 3 !important;
}

& #zen-sidebar-web-panel-wrapper:has(#zen-sidebar-web-panel[pinned='true']) {
margin-top: calc(var(--zen-element-separation) * 2) !important;
}
Expand All @@ -154,6 +158,9 @@
background: var(--zen-dialog-background);
padding-left: var(--zen-toolbox-padding) !important;

max-height: var(--zen-toolbar-height);
overflow: hidden;

& > * {
position: relative !important;
}
Expand Down Expand Up @@ -187,6 +194,8 @@
border-top-width: 1px;

top: -1px;
overflow: initial;
max-height: unset;

& #urlbar {
transform: translateY(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ height: var(--zen-toolbar-height);
transition-delay: 0.05s;

& > * {
transition: transform 0.4s ease-out;
transition: transform 0.2s ease-out;
}
}

&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {
transition-delay: 0.2s;
height: var(--zen-element-separation);
overflow: hidden;
opacity: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,6 @@
padding-top: var(--zen-element-separation);
align-items: center;
}
:root:has(&) #zen-sidebar-splitter {
display: none !important;
}
& #tabbrowser-arrowscrollbox-periphery {
& > toolbarbutton {
margin: 0 auto !important;
Expand Down Expand Up @@ -677,6 +674,10 @@
}
}

:root:not([zen-sidebar-expanded='true']) #zen-sidebar-splitter {
display: none !important;
}

/* Mark: Separator styling */
#zen-sidebar-splitter {
opacity: 0;
Expand Down Expand Up @@ -808,7 +809,7 @@
padding-inline-start: var(--zen-toolbox-padding);
}

#nav-bar:has(&) & {
#nav-bar & {
padding-inline-start: var(--toolbarbutton-outer-padding);
}

Expand Down
40 changes: 23 additions & 17 deletions src/browser/base/zen-components/ZenCompactMode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,33 +104,39 @@ var gZenCompactModeManager = {
return;
}
this._isAnimating = true;
const sidebarWidth = this.sidebar.getBoundingClientRect().width;
let sidebarWidth = this.sidebar.getBoundingClientRect().width;
if (sidebarWidth < 300) {
sidebarWidth += sidebarWidth < 210 ? 9 : 11; // Bug: IF sidebar is too small, it will not animate properly
}
if (canHideSidebar && isCompactMode) {
document.getElementById('browser').style.overflow = "hidden";
this.sidebar.style.position = "relative";
this.sidebar.style.transition = "margin .3s ease, transform .4s ease, opacity .3s ease";
this.sidebar.style.transition = "margin .3s ease, opacity .3s ease";
this.sidebar.style.left = "0";
this.sidebar.style.setProperty("opacity", "1", "important");
if (!this.sidebarIsOnRight) {
this.sidebar.style.marginLeft = `${-1 * sidebarWidth}px`;
} else {
this.sidebar.style.marginRight = `${-1 * sidebarWidth}px`;
}
this.sidebar.style.pointerEvents = "none";

setTimeout(() => {
window.requestAnimationFrame(() => {
this._isAnimating = false;
this.sidebar.style.removeProperty("opacity");
this.sidebar.style.removeProperty("position");
this.sidebar.style.removeProperty("transition");
this.sidebar.style.removeProperty("pointer-events");
this.sidebar.style.removeProperty("margin-left");
this.sidebar.style.removeProperty("margin-right");
this.sidebar.style.removeProperty("transform");
this.sidebar.style.removeProperty("left");
document.getElementById('browser').style.removeProperty("overflow");
});
}, 400);
window.requestAnimationFrame(() => {
this.sidebar.style.removeProperty("opacity");
setTimeout(() => {
window.requestAnimationFrame(() => {
this._isAnimating = false;
this.sidebar.style.removeProperty("opacity");
this.sidebar.style.removeProperty("position");
this.sidebar.style.removeProperty("transition");
this.sidebar.style.removeProperty("pointer-events");
this.sidebar.style.removeProperty("margin-left");
this.sidebar.style.removeProperty("margin-right");
this.sidebar.style.removeProperty("transform");
this.sidebar.style.removeProperty("left");
document.getElementById('browser').style.removeProperty("overflow");
});
}, 400);
});
} else if (canHideSidebar && !isCompactMode) {
document.getElementById('browser').style.overflow = "hidden";
this.sidebar.style.position = "relative";
Expand Down
6 changes: 3 additions & 3 deletions surfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"brandShortName": "Zen Browser",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.0.2-b.1",
"displayVersion": "1.0.2-b.2",
"github": {
"repo": "zen-browser/desktop"
},
Expand All @@ -40,7 +40,7 @@
"brandShortName": "Zen Twilight",
"brandFullName": "Zen Twilight",
"release": {
"displayVersion": "1.0.2-t.2",
"displayVersion": "1.0.2-t.3",
"github": {
"repo": "zen-browser/desktop"
}
Expand All @@ -54,4 +54,4 @@
"licenseType": "MPL-2.0"
},
"updateHostname": "updates.zen-browser.app"
}
}

0 comments on commit b8d97a5

Please sign in to comment.