fix: Fixed transitions on the urlbar while closing, b=(no-bug), c=common, compact-mode

This commit is contained in:
Mr. M
2025-05-05 22:54:58 +02:00
parent 1d269e9203
commit 2942ab3c08
6 changed files with 15 additions and 16 deletions

View File

@@ -78,9 +78,6 @@
</hbox>
<groupbox id="zenThemeGroup" data-category="paneZenLooks" hidden="true" class="highlighting-group">
<label><html:h2 data-l10n-id="zen-look-and-feel-urlbar-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-look-and-feel-urlbar-description" />
<label><html:h2 data-l10n-id="zen-look-and-feel-compact-view-header"/></label>
<description class="description-deemphasized" data-l10n-id="zen-look-and-feel-compact-view-description" />

View File

@@ -3,7 +3,6 @@
class="subcategory"
hidden="true"
data-category="paneZenTabManagement">
<html:h1 data-l10n-id="pane-workspaces-title"/>
</hbox>
<hbox id="zenTabManagementCategory"

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..a05dfd9b28c0c082579a5b53386de9ffbfc5e737 100644
index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..2c9920252aad3ae1528fc8e92906c4f1ccc11c75 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -21,14 +21,14 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..a05dfd9b28c0c082579a5b53386de9ff
// event but does not set the primary selection.
this._suppressPrimaryAdjustment = true;
+ const zenToolbox = this.document.getElementById("navigator-toolbox");
+ zenToolbox.setAttribute("supress-primary-adjustment", !(
+ this.window.document.documentElement.setAttribute("supress-primary-adjustment", !(
+ zenToolbox.hasAttribute("zen-has-hover") ||
+ zenToolbox.hasAttribute("zen-has-empty-tab") ||
+ zenToolbox.hasAttribute("zen-user-show")
+ ));
this.inputField.select();
+ this.document.ownerGlobal.setTimeout(() => {
+ zenToolbox.removeAttribute("supress-primary-adjustment");
+ this.window.document.documentElement.removeAttribute("supress-primary-adjustment");
+ }, 0);
this._suppressPrimaryAdjustment = false;
}
@@ -50,14 +50,14 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..a05dfd9b28c0c082579a5b53386de9ff
}
-
+ const zenToolbox = this.document.getElementById("navigator-toolbox");
+ zenToolbox.setAttribute("supress-primary-adjustment", !(
+ this.window.document.documentElement.setAttribute("supress-primary-adjustment", !(
+ zenToolbox.hasAttribute("zen-has-hover") ||
+ zenToolbox.hasAttribute("zen-has-empty-tab") ||
+ zenToolbox.hasAttribute("zen-user-show")
+ ));
this.handleNavigation({ event });
+ this.document.ownerGlobal.setTimeout(() => {
+ zenToolbox.removeAttribute("supress-primary-adjustment");
+ this.window.document.documentElement.removeAttribute("supress-primary-adjustment");
+ }, 0);
}
@@ -109,14 +109,14 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..a05dfd9b28c0c082579a5b53386de9ff
+
+ // Arc like URLbar: Blur the input on exit
+ const zenToolbox = this.document.getElementById("navigator-toolbox");
+ zenToolbox.setAttribute("supress-primary-adjustment", !(
+ this.window.document.documentElement.setAttribute("supress-primary-adjustment", !(
+ zenToolbox.hasAttribute("zen-has-hover") ||
+ zenToolbox.hasAttribute("zen-has-empty-tab") ||
+ zenToolbox.hasAttribute("zen-user-show")
+ ));
+ this.window.gBrowser.selectedBrowser.focus();
+ this.document.ownerGlobal.setTimeout(() => {
+ zenToolbox.removeAttribute("supress-primary-adjustment");
+ this.window.document.documentElement.removeAttribute("supress-primary-adjustment");
+ }, 0);
+
+ this.removeAttribute("zen-floating-urlbar");

View File

@@ -60,7 +60,7 @@
}
#urlbar:not([breakout-extend='true']) {
& #urlbar-background {
:root:not([supress-primary-adjustment]) & #urlbar-background {
transition: background-color 0.15s ease;
}
@@ -186,8 +186,11 @@
#identity-box:not([pageproxystate='invalid']) #identity-icon-box:not([open]) {
margin-inline-start: calc(-8px - 2 * var(--urlbar-icon-padding));
transform: translateX(100%);
transition: all 0.1s ease;
opacity: 0;
:root:not([supress-primary-adjustment]) & {
transition: all 0.1s ease;
}
}
#identity-permission-box > *:not(#permissions-granted-icon) {

View File

@@ -436,7 +436,7 @@ var gZenCompactModeManager = {
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) {
if (document.documentElement.getAttribute('supress-primary-adjustment') === 'true' || this._hasHoveredUrlbar) {
return;
}
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
@@ -469,7 +469,7 @@ var gZenCompactModeManager = {
if (
event.explicitOriginalTarget.closest('#urlbar[zen-floating-urlbar]') ||
this.sidebar.getAttribute('supress-primary-adjustment') === 'true' ||
document.documentElement.getAttribute('supress-primary-adjustment') === 'true' ||
this._hasHoveredUrlbar
) {
return;

View File

@@ -278,7 +278,7 @@
left var(--zen-compact-mode-time) var(--zen-compact-mode-func),
right var(--zen-compact-mode-time) var(--zen-compact-mode-func);
&:not([supress-primary-adjustment='true']) {
:root:not([supress-primary-adjustment='true']) & {
& #titlebar {
transition: none;
visibility: visible;