mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Fixed adding tabs to essentials with a different container, b=(closes #8019), c=compact-mode, tabs
This commit is contained in:
@@ -292,6 +292,8 @@ pref('image.jxl.enabled', true, locked);
|
|||||||
pref("svg.context-properties.content.enabled", true);
|
pref("svg.context-properties.content.enabled", true);
|
||||||
pref("image.avif.enabled", true, locked);
|
pref("image.avif.enabled", true, locked);
|
||||||
|
|
||||||
|
pref("media.eme.enabled", true);
|
||||||
|
|
||||||
// Smooth scrolling
|
// Smooth scrolling
|
||||||
#ifndef XP_MACOSX
|
#ifndef XP_MACOSX
|
||||||
pref("apz.overscroll.enabled", true);
|
pref("apz.overscroll.enabled", true);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
|
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
|
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
|
||||||
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
|
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
|
||||||
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
@@ -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)) {
|
+ if (lazy.ZEN_URLBAR_BEHAVIOR == 'float' || (lazy.ZEN_URLBAR_BEHAVIOR == 'floating-on-type' && !this.focusedViaMousedown)) {
|
||||||
+ this.setAttribute("zen-floating-urlbar", "true");
|
+ this.setAttribute("zen-floating-urlbar", "true");
|
||||||
+ // Divide the window by 2 and subtract the urlbar height to get the top
|
+ // 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 {
|
+ } else {
|
||||||
+ this.removeAttribute("zen-floating-urlbar");
|
+ this.removeAttribute("zen-floating-urlbar");
|
||||||
+ }
|
+ }
|
||||||
|
@@ -35,11 +35,12 @@ var gZenCompactModeManager = {
|
|||||||
lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode');
|
lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode');
|
||||||
this._wasInCompactMode = isCompactMode;
|
this._wasInCompactMode = isCompactMode;
|
||||||
|
|
||||||
this.addMouseActions();
|
|
||||||
this.addContextMenu();
|
this.addContextMenu();
|
||||||
},
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
this.addMouseActions();
|
||||||
|
|
||||||
Services.prefs.addObserver('zen.tabs.vertical.right-side', this._updateSidebarIsOnRight.bind(this));
|
Services.prefs.addObserver('zen.tabs.vertical.right-side', this._updateSidebarIsOnRight.bind(this));
|
||||||
|
|
||||||
gZenUIManager.addPopupTrackingAttribute(this.sidebar);
|
gZenUIManager.addPopupTrackingAttribute(this.sidebar);
|
||||||
@@ -412,26 +413,33 @@ var gZenCompactModeManager = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
addMouseActions() {
|
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++) {
|
for (let i = 0; i < this.hoverableElements.length; i++) {
|
||||||
let target = this.hoverableElements[i].element;
|
let target = this.hoverableElements[i].element;
|
||||||
const onEnter = (event) => {
|
const onEnter = (event) => {
|
||||||
if (event.type === 'mouseenter' && !event.target.matches(':hover')) return;
|
setTimeout(() => {
|
||||||
// Dont register the hover if the urlbar is floating and we are hovering over it
|
if (event.type === 'mouseenter' && !event.target.matches(':hover')) return;
|
||||||
this.clearFlashTimeout('has-hover' + target.id);
|
// Dont register the hover if the urlbar is floating and we are hovering over it
|
||||||
if (
|
this.clearFlashTimeout('has-hover' + target.id);
|
||||||
event.explicitOriginalTarget.closest('#urlbar[zen-floating-urlbar]') ||
|
if (this.sidebar.getAttribute('supress-primary-adjustment') === 'true' || this._hasHoveredUrlbar) {
|
||||||
this.sidebar.getAttribute('supress-primary-adjustment') === 'true'
|
return;
|
||||||
) {
|
|
||||||
this._hasHoveredUrlbar = this.sidebar.getAttribute('supress-primary-adjustment') !== 'true';
|
|
||||||
if (event.explicitOriginalTarget.closest('#urlbar[zen-floating-urlbar]')) {
|
|
||||||
window.requestAnimationFrame(() => {
|
|
||||||
target.removeAttribute('zen-has-hover');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return;
|
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
|
||||||
}
|
}, 0);
|
||||||
delete this._hasHoveredUrlbar;
|
|
||||||
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onLeave = (event) => {
|
const onLeave = (event) => {
|
||||||
@@ -463,7 +471,6 @@ var gZenCompactModeManager = {
|
|||||||
this.sidebar.getAttribute('supress-primary-adjustment') === 'true' ||
|
this.sidebar.getAttribute('supress-primary-adjustment') === 'true' ||
|
||||||
this._hasHoveredUrlbar
|
this._hasHoveredUrlbar
|
||||||
) {
|
) {
|
||||||
delete this._hasHoveredUrlbar;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,6 +512,12 @@ var gZenCompactModeManager = {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gURLBar.textbox.addEventListener('mouseleave', (event) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
delete this._hasHoveredUrlbar;
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_getCrossedEdge(posX, posY, element = document.documentElement, maxDistance = 10) {
|
_getCrossedEdge(posX, posY, element = document.documentElement, maxDistance = 10) {
|
||||||
|
@@ -665,6 +665,8 @@
|
|||||||
} else {
|
} else {
|
||||||
gBrowser.pinTab(tab);
|
gBrowser.pinTab(tab);
|
||||||
}
|
}
|
||||||
|
tab.setAttribute('zenDefaultUserContextId', true);
|
||||||
|
ZenWorkspaces.switchTabIfNeeded(tab);
|
||||||
this._onTabMove(tab);
|
this._onTabMove(tab);
|
||||||
this.onTabIconChanged(tab);
|
this.onTabIconChanged(tab);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user