Enhance window button handling for macOS and update event listener references

This commit is contained in:
mr. M
2024-11-28 01:22:22 +01:00
parent c146fea519
commit 16080cf46d
4 changed files with 17 additions and 9 deletions

View File

@@ -188,7 +188,16 @@ var gZenVerticalTabsManager = {
get actualWindowButtons() {
// we have multiple ".titlebar-buttonbox-container" in the DOM, because of the titlebar
if (!this.__actualWindowButtons) {
this.__actualWindowButtons = document.querySelector('#nav-bar .titlebar-buttonbox-container');
if (window.AppConstants.platform !== 'macosx') {
this.__actualWindowButtons = document.querySelector('#nav-bar .titlebar-buttonbox-container');
} else {
const buttons = document.querySelectorAll('.titlebar-buttonbox-container');
if (buttons.length === 2) {
this.__actualWindowButtons = buttons[1];
} else {
this.__actualWindowButtons = buttons[0];
}
}
}
return this.__actualWindowButtons;
},
@@ -307,7 +316,7 @@ var gZenVerticalTabsManager = {
if (isRightSide) {
document.getElementById('zen-appcontent-navbar-container').prepend(windowButtons);
} else {
navBar.prepend(windowButtons);
topButtons.prepend(windowButtons);
}
}
} else if (!isSingleToolbar && isCompactMode) {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/base/content/browser-sets.js b/browser/base/content/browser-sets.js
index 50da6424691ca230aa1a3a419cb69e66cf47b2c4..1f63f4bb7b75c940d5482dd4f13cebf452dddb74 100644
index 3031278749317d153624c6ccfbcc9d47aaf4089f..e67a8c3b56c01334627350c494b0139638ebf19a 100644
--- a/browser/base/content/browser-sets.js
+++ b/browser/base/content/browser-sets.js
@@ -245,7 +245,7 @@ document.addEventListener(
@@ -7,7 +7,7 @@ index 50da6424691ca230aa1a3a419cb69e66cf47b2c4..1f63f4bb7b75c940d5482dd4f13cebf4
});
- document.getElementById("mainKeyset").addEventListener("command", event => {
+ document.getElementById(ZEN_KEYSET_ID).addEventListener("command", event => {
+ document.getElementById("zenKeyset").addEventListener("command", event => {
switch (event.target.id) {
case "goHome":
BrowserCommands.home();

View File

@@ -121,8 +121,7 @@
& #zen-appcontent-navbar-container {
--zen-compact-toolbar-offset: 5px;
position: absolute;
top: 0;
transform: translateY(calc(-100% + var(--zen-element-separation) + 1px));
top: calc(-100% + var(--zen-element-separation) + 1px);
left: 0;
z-index: 10;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.3) !important;
@@ -159,7 +158,7 @@
opacity: 1;
border-top-width: 1px;
transform: translateY(-1px);
top: -1px;
}
}
}

View File

@@ -18,7 +18,7 @@
"brandShortName": "Zen Browser",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.0.1-a.20",
"displayVersion": "1.0.1-a.21",
"github": {
"repo": "zen-browser/desktop"
},
@@ -40,7 +40,7 @@
"brandShortName": "Zen Twilight",
"brandFullName": "Zen Twilight",
"release": {
"displayVersion": "1.0.1-t.20",
"displayVersion": "1.0.1-t.21",
"github": {
"repo": "zen-browser/desktop"
}