mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Prevent using single toolbar in popup windows and fixed one-offs UI
This commit is contained in:
@@ -122,6 +122,13 @@ var gZenVerticalTabsManager = {
|
|||||||
|| Services.prefs.getBoolPref('zen.view.experimental-force-window-controls-left'));
|
|| 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);
|
var updateEvent = this._updateEvent.bind(this);
|
||||||
|
|
||||||
this.initializePreferences(updateEvent);
|
this.initializePreferences(updateEvent);
|
||||||
@@ -264,7 +271,7 @@ var gZenVerticalTabsManager = {
|
|||||||
const isVerticalTabs = this._prefsVerticalTabs || forceMultipleToolbar;
|
const isVerticalTabs = this._prefsVerticalTabs || forceMultipleToolbar;
|
||||||
const isSidebarExpanded = this._prefsSidebarExpanded || !isVerticalTabs;
|
const isSidebarExpanded = this._prefsSidebarExpanded || !isVerticalTabs;
|
||||||
const isRightSide = this._prefsRightSide && 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');
|
const titlebar = document.getElementById('titlebar');
|
||||||
|
|
||||||
gBrowser.tabContainer.setAttribute('orient', isVerticalTabs ? 'vertical' : 'horizontal');
|
gBrowser.tabContainer.setAttribute('orient', isVerticalTabs ? 'vertical' : 'horizontal');
|
||||||
|
@@ -4,6 +4,10 @@ height: var(--zen-toolbar-height);
|
|||||||
& {
|
& {
|
||||||
transition: height 0.2s ease-out, opacity 0.2s ease-out;
|
transition: height 0.2s ease-out, opacity 0.2s ease-out;
|
||||||
transition-delay: 0.05s;
|
transition-delay: 0.05s;
|
||||||
|
|
||||||
|
:root[inDOMFullscreen='true'] & {
|
||||||
|
max-height: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {
|
&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {
|
||||||
|
@@ -328,6 +328,16 @@ button.popup-notification-dropmarker {
|
|||||||
padding-right: var(--zen-element-separation) !important;
|
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] {
|
#urlbar[open] {
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
min-width: 600px;
|
min-width: 600px;
|
||||||
|
@@ -1157,8 +1157,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
// Animate acordingly
|
// Animate acordingly
|
||||||
if (previousWorkspace && !this._animatingChange) {
|
if (previousWorkspace && !this._animatingChange) {
|
||||||
// we want to know if we are moving forward or backward in sense of animation
|
// we want to know if we are moving forward or backward in sense of animation
|
||||||
let isNextWorkspace = onInit ||
|
let isNextWorkspace = onInit ||
|
||||||
(workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid)
|
(workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid)
|
||||||
< workspaces.workspaces.findIndex((w) => w.uuid === window.uuid));
|
< workspaces.workspaces.findIndex((w) => w.uuid === window.uuid));
|
||||||
gBrowser.tabContainer.setAttribute('zen-workspace-animation', isNextWorkspace ? 'next' : 'previous');
|
gBrowser.tabContainer.setAttribute('zen-workspace-animation', isNextWorkspace ? 'next' : 'previous');
|
||||||
this._animatingChange = true;
|
this._animatingChange = true;
|
||||||
@@ -1398,16 +1398,18 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
const tab = gBrowser.getTabForBrowser(browser);
|
const tab = gBrowser.getTabForBrowser(browser);
|
||||||
const workspaceID = tab.getAttribute('zen-workspace-id');
|
const workspaceID = tab.getAttribute('zen-workspace-id');
|
||||||
const isEssential = tab.getAttribute("zen-essential") === "true";
|
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
|
// Only update last selected tab for non-essential tabs in their workspace
|
||||||
if (!isEssential && workspaceID === activeWorkspace.uuid) {
|
if (!isEssential && workspaceID === activeWorkspace.uuid) {
|
||||||
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
|
this._lastSelectedWorkspaceTabs[workspaceID] = tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch workspace if needed
|
// Switch workspace if needed
|
||||||
if (workspaceID && workspaceID !== activeWorkspace.uuid) {
|
if (workspaceID && workspaceID !== activeWorkspace.uuid) {
|
||||||
await parent.ZenWorkspaces.changeWorkspace({ uuid: workspaceID });
|
await parent.ZenWorkspaces.changeWorkspace({ uuid: workspaceID });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user