Fix toolbar button behavior and enhance URL bar styles for floating mode

This commit is contained in:
mr. M
2024-12-14 19:07:44 +01:00
parent a35c0fc1a7
commit c077834553
4 changed files with 14 additions and 9 deletions

View File

@@ -379,7 +379,7 @@ var gZenVerticalTabsManager = {
} }
// Case: single toolbar, not compact mode, not right side and macos styled buttons // Case: single toolbar, not compact mode, not right side and macos styled buttons
if (doNotChangeWindowButtons && isSingleToolbar && !isCompactMode && !isRightSide && !this.isWindowsStyledButtons) { if (!doNotChangeWindowButtons && isSingleToolbar && !isCompactMode && !isRightSide && !this.isWindowsStyledButtons) {
topButtons.prepend(windowButtons); topButtons.prepend(windowButtons);
} }

View File

@@ -4,6 +4,10 @@ height: var(--zen-toolbar-height);
& { & {
transition: height 0.2s ease, opacity 0.2s ease-out; transition: height 0.2s ease, opacity 0.2s ease-out;
transition-delay: 0.05s; transition-delay: 0.05s;
& > * {
transition: transform 0.4s ease-out;
}
} }
&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) { &:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {
@@ -12,6 +16,7 @@ height: var(--zen-toolbar-height);
overflow: hidden; overflow: hidden;
opacity: 0; opacity: 0;
& > * { & > * {
transform: translateY(-100%);
pointer-events: none; pointer-events: none;
} }
} }

View File

@@ -338,9 +338,6 @@ button.popup-notification-dropmarker {
} }
#urlbar[open] { #urlbar[open] {
--urlbar-container-height: 55px !important;
--urlbar-margin-inline: 10px !important;
font-size: 1.1em;
& #urlbar-background { & #urlbar-background {
/* We cant have a transparent background with a backdrop-filter because on normal websites, /* We cant have a transparent background with a backdrop-filter because on normal websites,
@@ -354,13 +351,16 @@ button.popup-notification-dropmarker {
} }
:root[zen-single-toolbar='true'] #urlbar[open] { :root[zen-single-toolbar='true'] #urlbar[open] {
min-width: 45vw; min-width: 30vw;
} }
#urlbar[open][zen-floating-urlbar='true'] { #urlbar[open][zen-floating-urlbar='true'] {
z-index: 1000; z-index: 1000;
max-width: 45vw; max-width: 45vw;
top: 0 !important; min-width: 45vw !important;
font-size: 1.1em;
--urlbar-container-height: 55px !important;
--urlbar-margin-inline: 10px !important;
& #identity-box { & #identity-box {
margin-right: var(--urlbar-margin-inline); margin-right: var(--urlbar-margin-inline);

View File

@@ -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 c504c9afc43785b5f003bb1f9f1dfbddef38d78b..289a9dfdc2fd38f7d7c3571732e3897aa978d8d9 100644 index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..f4167cf9f3dcbbb8666118436e9f79137caf565a 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
@@ -65,6 +65,13 @@ XPCOMUtils.defineLazyPreferenceGetter( @@ -65,6 +65,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -31,7 +31,7 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..289a9dfdc2fd38f7d7c3571732e3897a
} }
_on_click(event) { _on_click(event) {
+ if (lazy.ZEN_URLBAR_BEHAVIOR === 'float') { + if (lazy.ZEN_URLBAR_BEHAVIOR === 'float' && event.target == this.inputField) {
+ event.zenOriginalTarget = this.textbox; + event.zenOriginalTarget = this.textbox;
+ this._on_mousedown(event); + this._on_mousedown(event);
+ } + }
@@ -58,7 +58,7 @@ index c504c9afc43785b5f003bb1f9f1dfbddef38d78b..289a9dfdc2fd38f7d7c3571732e3897a
- this.focusedViaMousedown = !this.focused; - this.focusedViaMousedown = !this.focused;
- this._preventClickSelectsAll = this.focused; - this._preventClickSelectsAll = this.focused;
+ this.focusedViaMousedown = !(lazy.ZEN_URLBAR_BEHAVIOR === 'float' ? this.hasAttribute("breakout-extend") : this.focused); + this.focusedViaMousedown = !(lazy.ZEN_URLBAR_BEHAVIOR === 'default' ? this.focused : this.hasAttribute("breakout-extend"));
+ this._preventClickSelectsAll = lazy.ZEN_URLBAR_BEHAVIOR === 'default' ? this.focused : this.hasAttribute("breakout-extend"); + this._preventClickSelectsAll = lazy.ZEN_URLBAR_BEHAVIOR === 'default' ? this.focused : this.hasAttribute("breakout-extend");
// Keep the focus status, since the attribute may be changed // Keep the focus status, since the attribute may be changed