feat: enhance panel UI positioning and improve hover state handling

This commit is contained in:
mr. M
2025-03-17 20:41:24 +01:00
parent b8ae7401a4
commit 630152b91e
4 changed files with 31 additions and 26 deletions

View File

@@ -261,6 +261,10 @@ var gZenUIManager = {
this._toastContainer.setAttribute('hidden', 'true');
}
},
get panelUIPosition() {
return gZenVerticalTabsManager._hasSetSingleToolbar ? 'bottomleft topleft' : 'bottomright topright';
},
};
var gZenVerticalTabsManager = {

View File

@@ -40,6 +40,11 @@ var gZenCompactModeManager = {
// Clear hover states when window state changes (minimize, maximize, etc.)
window.addEventListener('sizemodechange', () => this._clearAllHoverStates());
window.addEventListener('mouseenter', (event) => {
const buttons = gZenVerticalTabsManager.actualWindowButtons;
buttons.removeAttribute('zen-has-hover');
});
},
get preference() {
@@ -363,13 +368,14 @@ var gZenCompactModeManager = {
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
if (event.target.querySelector('#urlbar[zen-floating-urlbar]')) return;
this.clearFlashTimeout('has-hover' + target.id);
window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true'));
};
const onLeave = (event) => {
if (AppConstants.platform == 'macosx') {
const buttonRect = gZenVerticalTabsManager.actualWindowButtons.getBoundingClientRect();
const MAC_WINDOW_BUTTONS_X_BORDER = buttonRect.width + buttonRect.x;
const MAC_WINDOW_BUTTONS_Y_BORDER = buttonRect.height + buttonRect.y;
if (

View File

@@ -1,17 +1,13 @@
diff --git a/browser/components/customizableui/content/panelUI.inc.xhtml b/browser/components/customizableui/content/panelUI.inc.xhtml
index 956a6ae45d7adbec1513c5af528ebb687a4b7d0d..83b23e84cb6895497c1346f7c4aff15173e67b5c 100644
index c78f08bdd3fc4d01e10552ef65c2d5813dd053e8..154fb1de2ab9384937d02c14cb7c9c607b330da9 100644
--- a/browser/components/customizableui/content/panelUI.inc.xhtml
+++ b/browser/components/customizableui/content/panelUI.inc.xhtml
@@ -81,9 +81,10 @@
<html:span data-l10n-id="unified-extensions-header-title"/>
</html:h1>
</box>
-
+ <html:p id="unified-extensions-description" data-l10n-id="unified-extensions-description" class="panel-description"/>
+#if 0
<toolbarseparator />
-
+#endif
<vbox class="panel-subview-body" context="unified-extensions-context-menu">
<html:div id="unified-extensions-messages-container">
<!-- messages will be inserted here -->
@@ -132,7 +132,7 @@
<panel id="appMenu-notification-popup"
class="popup-notification-panel panel-no-padding"
type="arrow"
- position="after_start"
+ position="after_end"
flip="slide"
orient="vertical"
noautofocus="true"

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js
index 1805bad6c58e060533f634ed9e511c05cad3ded1..f153761e406535270343fa1f430dea4f740cb2fc 100644
index 7583473ee73538b2fa54337bfd844f03f261be49..559b593a6874296bd5894c5985f8eeb680cd3886 100644
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -496,8 +496,7 @@ const PanelUI = {
@@ -515,8 +515,7 @@ const PanelUI = {
tempPanel.setAttribute("animate", "false");
}
tempPanel.setAttribute("context", "");
@@ -12,13 +12,12 @@ index 1805bad6c58e060533f634ed9e511c05cad3ded1..f153761e406535270343fa1f430dea4f
.appendChild(tempPanel);
let multiView = document.createXULElement("panelmultiview");
@@ -544,8 +543,8 @@ const PanelUI = {
}
@@ -960,7 +959,7 @@ const PanelUI = {
el.removeAttribute("data-lazy-l10n-id");
});
if (viewShown) {
- CustomizableUI.addPanelCloseListeners(tempPanel);
tempPanel.addEventListener("popuphidden", panelRemover);
+ CustomizableUI.addPanelCloseListeners(tempPanel);
} else {
panelRemover();
}
- this.notificationPanel.openPopup(anchor, "bottomright topright");
+ this.notificationPanel.openPopup(anchor, gZenUIManager.panelUIPosition);
},
_clearNotificationPanel() {