fix: Fixed ctrl+K into the urlbar having the wrong coordinates, b=(closes #8093), c=common, tabs, workspaces

This commit is contained in:
Mr. M
2025-05-06 07:23:14 +02:00
parent 0a39cdef7c
commit 808e186dae
4 changed files with 17 additions and 3 deletions

View File

@@ -43,9 +43,10 @@ var gZenUIManager = {
},
updateTabsToolbar() {
const kUrlbarHeight = 440;
gURLBar.textbox.style.setProperty(
'--zen-urlbar-top',
`${window.innerHeight / 2 - gURLBar.textbox.getBoundingClientRect().height / 2}px`
`${window.innerHeight / 2 - Math.max(kUrlbarHeight, gURLBar.textbox.getBoundingClientRect().height) / 2}px`
);
gZenVerticalTabsManager.actualWindowButtons.removeAttribute('zen-has-hover');
gZenVerticalTabsManager.recalculateURLBarHeight();
@@ -83,6 +84,9 @@ var gZenUIManager = {
onFloatingURLBarOpen() {
requestAnimationFrame(() => {
this.updateTabsToolbar();
requestAnimationFrame(() => {
this.updateTabsToolbar();
});
});
},

View File

@@ -208,6 +208,10 @@
Segoe UI Symbol,
Noto Color Emoji;
}
&:not([chromehidden~='toolbar']) {
min-height: 495px !important;
}
}
@media (prefers-color-scheme: dark) {

View File

@@ -47,6 +47,8 @@
}
class ZenPinnedTabManager extends ZenDOMOperatedFeature {
MAX_ESSENTIALS_TABS = 12;
async init() {
if (!this.enabled) {
return;
@@ -639,6 +641,10 @@
: [TabContextMenu.contextTab];
for (let i = 0; i < tabs.length; i++) {
let tab = tabs[i];
const section = ZenWorkspaces.getEssentialsSection(tab);
if (section.children.length >= this.MAX_ESSENTIALS_TABS) {
continue;
}
if (tab.hasAttribute('zen-essential')) {
continue;
}
@@ -658,7 +664,7 @@
});
tab.setAttribute('zen-essential', 'true');
} else {
ZenWorkspaces.getEssentialsSection(tab).appendChild(tab);
section.appendChild(tab);
}
gBrowser.tabContainer._invalidateCachedTabs();
} else {

View File

@@ -2271,7 +2271,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const containerId = workspace.containerTabId?.toString();
const workspaces = await this._workspaces();
// Save current tab as last selected for old workspace if it shouldn't be visible in new workspace
if (oldWorkspaceId && oldWorkspaceId !== workspace.uuid) {
this._lastSelectedWorkspaceTabs[oldWorkspaceId] = gZenGlanceManager.getTabOrGlanceParent(currentSelectedTab);