Add zenKeyset definition and update URL bar behavior for floating logic

This commit is contained in:
mr. M
2025-01-05 22:42:12 +01:00
parent 4e720eb4d2
commit bb96eb1a8d
3 changed files with 15 additions and 12 deletions

View File

@@ -0,0 +1,9 @@
diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc
index 493c593d66883082c2a4df87c4706f919ea675f8..aaaa833b64b0fd890aa2a0794eaeb7e41f002f06 100644
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -393,3 +393,4 @@
internal="true"/>
#endif
</keyset>
+ <keyset id="zenKeyset"></keyset>

View File

@@ -995,11 +995,7 @@ var gZenKeyboardShortcutsManager = {
return browser.gZenKeyboardShortcutsManager._zenKeyset;
}
browser.gZenKeyboardShortcutsManager._zenKeyset = browser.document.createXULElement('keyset');
browser.gZenKeyboardShortcutsManager._zenKeyset.id = ZEN_KEYSET_ID;
const mainKeyset = browser.document.getElementById(ZEN_MAIN_KEYSET_ID);
mainKeyset.after(browser.gZenKeyboardShortcutsManager._zenKeyset);
throw new Error('Zen keyset not found');
}
return browser.gZenKeyboardShortcutsManager._zenKeyset;
},

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index 3ab07e5864b3bb200608e7f619645f92ade129fe..19efe7e6b78a1ba87c93f39ca8bde5046312b0a9 100644
index 3ab07e5864b3bb200608e7f619645f92ade129fe..31085d82271b0259cd69ec9691ea5f33fe29e19e 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -67,6 +67,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -16,21 +16,19 @@ index 3ab07e5864b3bb200608e7f619645f92ade129fe..19efe7e6b78a1ba87c93f39ca8bde504
const DEFAULT_FORM_HISTORY_NAME = "searchbar-history";
const SEARCH_BUTTON_CLASS = "urlbar-search-button";
@@ -2152,6 +2159,13 @@ export class UrlbarInput {
@@ -2152,6 +2159,11 @@ export class UrlbarInput {
this.setAttribute("breakout-extend", "true");
+ if (lazy.ZEN_URLBAR_BEHAVIOR == 'float' || (lazy.ZEN_URLBAR_BEHAVIOR == 'floating-on-type' && !this.focusedViaMousedown)) {
+ this.setAttribute("zen-floating-urlbar", "true");
+ this.textbox.classList.add("zen-compact-mode-ignore");
+ } else {
+ this.removeAttribute("zen-floating-urlbar");
+ this.textbox.classList.remove("zen-compact-mode-ignore");
+ }
// Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) {
@@ -3875,6 +3889,11 @@ export class UrlbarInput {
@@ -3875,6 +3887,11 @@ export class UrlbarInput {
}
_on_click(event) {
@@ -42,7 +40,7 @@ index 3ab07e5864b3bb200608e7f619645f92ade129fe..19efe7e6b78a1ba87c93f39ca8bde504
if (
event.target == this.inputField ||
event.target == this._inputContainer ||
@@ -3986,9 +4005,12 @@ export class UrlbarInput {
@@ -3986,9 +4003,12 @@ export class UrlbarInput {
}
_on_mousedown(event) {
@@ -56,7 +54,7 @@ index 3ab07e5864b3bb200608e7f619645f92ade129fe..19efe7e6b78a1ba87c93f39ca8bde504
if (
event.target != this.inputField &&
@@ -3998,8 +4020,8 @@ export class UrlbarInput {
@@ -3998,8 +4018,8 @@ export class UrlbarInput {
break;
}