This commit is contained in:
Mr. M
2025-05-04 21:32:01 +02:00
6 changed files with 43 additions and 25 deletions

View File

@@ -204,7 +204,6 @@ pref('zen.startup.smooth-scroll-in-tabs', true);
pref('zen.workspaces.hide-default-container-indicator', true);
pref('zen.workspaces.force-container-workspace', false);
pref('zen.workspaces.open-new-tab-if-last-unpinned-tab-is-closed', false);
pref('zen.workspaces.show-workspace-indicator', true);
pref('zen.workspaces.swipe-actions', true);
pref('zen.workspaces.wrap-around-navigation', true);
pref('zen.workspaces.natural-scroll', false);
@@ -293,6 +292,8 @@ pref('image.jxl.enabled', true, locked);
pref("svg.context-properties.content.enabled", true);
pref("image.avif.enabled", true, locked);
pref("media.eme.enabled", true);
// Smooth scrolling
#ifndef XP_MACOSX
pref("apz.overscroll.enabled", true);

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8d1a80e97fa711352d4b725f2d299a073dbae4db 100644
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..f001ffe262b26389c5af68e29d0785500969c344 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -93,7 +93,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..8d1a80e97fa711352d4b725f2d299a07
+ if (lazy.ZEN_URLBAR_BEHAVIOR == 'float' || (lazy.ZEN_URLBAR_BEHAVIOR == 'floating-on-type' && !this.focusedViaMousedown)) {
+ this.setAttribute("zen-floating-urlbar", "true");
+ // Divide the window by 2 and subtract the urlbar height to get the top
+ this.textbox.style.setProperty("--zen-urlbar-top", `${(this.window.innerHeight / 6)}px`);
+ this.textbox.style.setProperty("--zen-urlbar-top", `${(this.window.innerHeight / 4)}px`);
+ } else {
+ this.removeAttribute("zen-floating-urlbar");
+ }

View File

@@ -35,11 +35,12 @@ var gZenCompactModeManager = {
lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode');
this._wasInCompactMode = isCompactMode;
this.addMouseActions();
this.addContextMenu();
},
init() {
this.addMouseActions();
Services.prefs.addObserver('zen.tabs.vertical.right-side', this._updateSidebarIsOnRight.bind(this));
gZenUIManager.addPopupTrackingAttribute(this.sidebar);
@@ -412,20 +413,33 @@ var gZenCompactModeManager = {
},
addMouseActions() {
gURLBar.textbox.addEventListener('mouseenter', (event) => {
if (!gZenVerticalTabsManager._hasSetSingleToolbar) {
return;
}
if (event.target.closest('#urlbar[zen-floating-urlbar]')) {
// Ignore sidebar mouse enter if the urlbar is floating
this.clearFlashTimeout('has-hover' + gZenVerticalTabsManager._hasSetSingleToolbar);
window.requestAnimationFrame(() => {
this.sidebar.removeAttribute('zen-has-hover');
});
this._hasHoveredUrlbar = true;
return;
}
});
for (let i = 0; i < this.hoverableElements.length; i++) {
let target = this.hoverableElements[i].element;
const onEnter = (event) => {
if (event.type === 'mouseenter' && !event.target.matches(':hover')) return;
// Dont register the hover if the urlbar is floating and we are hovering over it
this.clearFlashTimeout('has-hover' + target.id);
if (
event.explicitOriginalTarget.closest('#urlbar[zen-floating-urlbar]') ||
this.sidebar.getAttribute('supress-primary-adjustment') === 'true'
) {
this._hasHoveredUrlbar = this.sidebar.getAttribute('supress-primary-adjustment') !== 'true';
return;
}
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
setTimeout(() => {
if (event.type === 'mouseenter' && !event.target.matches(':hover')) return;
// Dont register the hover if the urlbar is floating and we are hovering over it
this.clearFlashTimeout('has-hover' + target.id);
if (this.sidebar.getAttribute('supress-primary-adjustment') === 'true' || this._hasHoveredUrlbar) {
return;
}
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
}, 0);
};
const onLeave = (event) => {
@@ -457,7 +471,6 @@ var gZenCompactModeManager = {
this.sidebar.getAttribute('supress-primary-adjustment') === 'true' ||
this._hasHoveredUrlbar
) {
delete this._hasHoveredUrlbar;
return;
}
@@ -499,6 +512,12 @@ var gZenCompactModeManager = {
);
}
});
gURLBar.textbox.addEventListener('mouseleave', (event) => {
setTimeout(() => {
delete this._hasHoveredUrlbar;
}, 0);
});
},
_getCrossedEdge(posX, posY, element = document.documentElement, maxDistance = 10) {

View File

@@ -665,6 +665,8 @@
} else {
gBrowser.pinTab(tab);
}
tab.setAttribute('zenDefaultUserContextId', true);
ZenWorkspaces.switchTabIfNeeded(tab);
this._onTabMove(tab);
this.onTabIconChanged(tab);

View File

@@ -799,10 +799,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const currentTab = gBrowser.selectedTab;
let showed = false;
if (this._tabToRemoveForEmpty) {
this.selectEmptyTab();
gBrowser.removeTab(this._tabToRemoveForEmpty);
if (gZenVerticalTabsManager._canReplaceNewTab) {
this.selectEmptyTab();
gBrowser.removeTab(this._tabToRemoveForEmpty);
showed = true;
}
delete this._tabToRemoveForEmpty;
showed = true;
} else {
const currentTabURL = currentTab.linkedBrowser?.currentURI?.spec;
// Check for empty tab being restored

View File

@@ -507,12 +507,6 @@
}
}
@media not -moz-pref('zen.workspaces.show-workspace-indicator') {
#zen-current-workspace-indicator-container {
display: none !important;
}
}
#zen-current-workspace-indicator-container[hidden='true'] {
display: none !important;
}