Prevent using single toolbar in popup windows and fixed one-offs UI

This commit is contained in:
mr. M
2024-12-05 18:35:38 +01:00
parent 3811d7739d
commit f6cbe1c4bc
4 changed files with 34 additions and 11 deletions

View File

@@ -122,6 +122,13 @@ var gZenVerticalTabsManager = {
|| Services.prefs.getBoolPref('zen.view.experimental-force-window-controls-left'));
});
ChromeUtils.defineLazyGetter(this, 'hidesTabsToolbar', () => {
return (
document.documentElement.getAttribute('chromehidden').includes('toolbar') ||
document.documentElement.getAttribute('chromehidden').includes('menubar')
);
});
var updateEvent = this._updateEvent.bind(this);
this.initializePreferences(updateEvent);
@@ -264,7 +271,7 @@ var gZenVerticalTabsManager = {
const isVerticalTabs = this._prefsVerticalTabs || forceMultipleToolbar;
const isSidebarExpanded = this._prefsSidebarExpanded || !isVerticalTabs;
const isRightSide = this._prefsRightSide && isVerticalTabs;
const isSingleToolbar = ((this._prefsUseSingleToolbar && (isVerticalTabs && isSidebarExpanded) )|| !isVerticalTabs) && !forceMultipleToolbar;
const isSingleToolbar = ((this._prefsUseSingleToolbar && (isVerticalTabs && isSidebarExpanded) )|| !isVerticalTabs) && !forceMultipleToolbar && !this.hidesTabsToolbar;
const titlebar = document.getElementById('titlebar');
gBrowser.tabContainer.setAttribute('orient', isVerticalTabs ? 'vertical' : 'horizontal');

View File

@@ -4,6 +4,10 @@ height: var(--zen-toolbar-height);
& {
transition: height 0.2s ease-out, opacity 0.2s ease-out;
transition-delay: 0.05s;
:root[inDOMFullscreen='true'] & {
max-height: 0;
}
}
&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {

View File

@@ -328,6 +328,16 @@ button.popup-notification-dropmarker {
padding-right: var(--zen-element-separation) !important;
}*/
#urlbar {
& .search-panel-one-offs-header {
display: none;
}
& .search-panel-one-offs-container .searchbar-engine-one-off-item {
box-shadow: none;
}
}
#urlbar[open] {
z-index: 1000;
min-width: 600px;

View File

@@ -1157,8 +1157,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
// Animate acordingly
if (previousWorkspace && !this._animatingChange) {
// we want to know if we are moving forward or backward in sense of animation
let isNextWorkspace = onInit ||
(workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid)
let isNextWorkspace = onInit ||
(workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid)
< workspaces.workspaces.findIndex((w) => w.uuid === window.uuid));
gBrowser.tabContainer.setAttribute('zen-workspace-animation', isNextWorkspace ? 'next' : 'previous');
this._animatingChange = true;
@@ -1398,16 +1398,18 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const tab = gBrowser.getTabForBrowser(browser);
const workspaceID = tab.getAttribute('zen-workspace-id');
const isEssential = tab.getAttribute("zen-essential") === "true";
const activeWorkspace = await parent.ZenWorkspaces.getActiveWorkspace();
if (!isEssential) {
const activeWorkspace = await parent.ZenWorkspaces.getActiveWorkspace();
// Only update last selected tab for non-essential tabs in their workspace
if (!isEssential && workspaceID === activeWorkspace.uuid) {
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
}
// Only update last selected tab for non-essential tabs in their workspace
if (!isEssential && workspaceID === activeWorkspace.uuid) {
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
}
// Switch workspace if needed
if (workspaceID && workspaceID !== activeWorkspace.uuid) {
await parent.ZenWorkspaces.changeWorkspace({ uuid: workspaceID });
// Switch workspace if needed
if (workspaceID && workspaceID !== activeWorkspace.uuid) {
await parent.ZenWorkspaces.changeWorkspace({ uuid: workspaceID });
}
}
}