forked from ZenBrowserMirrors/zen-desktop
fix: Small fixes for split view and glance, b=(no-bug), c=common, compact-mode, split-view, tabs
This commit is contained in:
parent
590ba6de1b
commit
3b56abf090
12 changed files with 46 additions and 60 deletions
2
l10n
2
l10n
|
@ -1 +1 @@
|
|||
Subproject commit 9b1df3a65db379b357ac864f84ad08313b3d4c94
|
||||
Subproject commit ebecb32da8929e4f14f9a20f40acb9dab401101c
|
|
@ -1232,11 +1232,6 @@ Preferences.addAll([
|
|||
type: 'bool',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
id: 'browser.tabs.unloadOnLowMemory',
|
||||
type: 'bool',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
id: 'zen.mods.auto-update',
|
||||
type: 'bool',
|
||||
|
|
|
@ -31,15 +31,6 @@
|
|||
<html:h1 data-l10n-id="pane-zen-tabs-unloader-title"/>
|
||||
</hbox>
|
||||
|
||||
<groupbox id="zenTabsUnloadGroup" data-category="paneZenTabManagement" hidden="true" class="highlighting-group">
|
||||
<label><html:h2 data-l10n-id="zen-tabs-unloader-header"/></label>
|
||||
<description class="description-deemphasized" data-l10n-id="zen-tabs-unloader-description" />
|
||||
|
||||
<checkbox id="zenTabsUnloadActivate"
|
||||
data-l10n-id="zen-tabs-unloader-enabled"
|
||||
preference="browser.tabs.unloadOnLowMemory"/>
|
||||
</groupbox>
|
||||
|
||||
<hbox id="zenPinnedTabsManagerCategory"
|
||||
class="subcategory"
|
||||
hidden="true"
|
||||
|
|
|
@ -121,6 +121,10 @@
|
|||
list-style-image: url('tab.svg') !important;
|
||||
}
|
||||
|
||||
#context-navigation > menuitem {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#history-panelmenu,
|
||||
.urlbarView-row[source='history']
|
||||
> .urlbarView-row-inner
|
||||
|
|
|
@ -1068,12 +1068,7 @@ var gZenVerticalTabsManager = {
|
|||
!gZenVerticalTabsManager._prefsSidebarExpanded
|
||||
)
|
||||
return;
|
||||
this._tabEdited =
|
||||
event.target.closest('.tabbrowser-tab') ||
|
||||
event.target.closest('.zen-current-workspace-indicator-name') ||
|
||||
gZenWorkspaces.activeWorkspaceIndicator.querySelector(
|
||||
'.zen-current-workspace-indicator-name'
|
||||
);
|
||||
this._tabEdited = event.target.closest('.tabbrowser-tab');
|
||||
if (
|
||||
!this._tabEdited ||
|
||||
((!this._tabEdited.pinned || this._tabEdited.hasAttribute('zen-essential')) && isTab)
|
||||
|
|
|
@ -90,6 +90,9 @@ class ZenUIMigration {
|
|||
}
|
||||
|
||||
_migrateV4(win) {
|
||||
if (AppConstants.platform === 'linux') {
|
||||
return;
|
||||
}
|
||||
Services.prefs.setBoolPref(
|
||||
'browser.tabs.unloadOnLowMemory',
|
||||
Services.prefs.getBoolPref('zen.tab-unloader.enabled', true)
|
||||
|
|
|
@ -78,16 +78,6 @@
|
|||
transition: background-color var(--inactive-window-transition);
|
||||
}
|
||||
|
||||
@media (not (-moz-windows-mica)) and -moz-pref('zen.view.grey-out-inactive-windows') {
|
||||
transition: color var(--inactive-window-transition);
|
||||
:root:not([zen-welcome-stage]) &:-moz-window-inactive {
|
||||
color: var(--toolbox-textcolor-inactive);
|
||||
&::before {
|
||||
background-color: var(--toolbox-bgcolor-inactive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#zen-browser-grain {
|
||||
content: '';
|
||||
width: 100%;
|
||||
|
@ -131,9 +121,7 @@
|
|||
z-index: 1;
|
||||
}
|
||||
|
||||
@media (-moz-windows-accent-color-in-titlebar) and (-moz-windows-mica) {
|
||||
background-color: ActiveCaption;
|
||||
color: CaptionText;
|
||||
@media -moz-pref('zen.view.grey-out-inactive-windows') {
|
||||
transition: background-color var(--inactive-window-transition);
|
||||
&:-moz-window-inactive {
|
||||
background-color: InactiveCaption;
|
||||
|
@ -264,6 +252,7 @@
|
|||
opacity: 0;
|
||||
transition: opacity 0.1s ease-in-out;
|
||||
pointer-events: none;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
&:hover::before {
|
||||
|
|
|
@ -41,7 +41,7 @@ menupopup,
|
|||
panel {
|
||||
--panel-background: var(--arrowpanel-background);
|
||||
--panel-border-radius: var(--zen-native-inner-radius);
|
||||
--menuitem-padding: 6px 5px !important;
|
||||
--menuitem-padding: 6px !important;
|
||||
}
|
||||
|
||||
/* split-view popup */
|
||||
|
|
|
@ -91,10 +91,6 @@ var gZenCompactModeManager = {
|
|||
this.preference === value ||
|
||||
document.documentElement.hasAttribute('zen-compact-animating')
|
||||
) {
|
||||
if (typeof this._wasInCompactMode !== 'undefined') {
|
||||
// We wont do anything with it anyway, so we remove it
|
||||
delete this._wasInCompactMode;
|
||||
}
|
||||
// We dont want the user to be able to spam the button
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -210,6 +210,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
|||
const node = this.getSplitNodeFromTab(tab);
|
||||
const toUpdate = this.removeNode(node);
|
||||
this.applyGridLayout(toUpdate);
|
||||
// Select next tab if the removed tab was selected
|
||||
if (gBrowser.selectedTab === tab) {
|
||||
gBrowser.selectedTab = group.tabs[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -946,8 +950,8 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
|||
window.gContextMenu.contentData.docLocation ||
|
||||
window.gContextMenu.target.ownerDocument.location.href;
|
||||
const currentTab = gZenGlanceManager.getTabOrGlanceParent(window.gBrowser.selectedTab);
|
||||
const newTab = this.openAndSwitchToTab(url);
|
||||
this.splitTabs([currentTab, newTab]);
|
||||
const newTab = this.openAndSwitchToTab(url, { inBackground: false });
|
||||
this.splitTabs([currentTab, newTab], 'grid', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1090,7 +1094,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
|||
};
|
||||
this._data.push(splitData);
|
||||
if (!this._sessionRestoring) {
|
||||
window.gBrowser.selectedTab = tabs[0];
|
||||
window.gBrowser.selectedTab = tabs[initialIndex] ?? tabs[0];
|
||||
}
|
||||
|
||||
// Add tabs to the split view group
|
||||
|
|
|
@ -41,6 +41,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
#zen-splitview-dropzone {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
#tabbrowser-tabpanels[zen-split-view='true']:not([zen-split-resizing]) > [zen-split='true'] {
|
||||
transition: inset 0.09s ease-out !important;
|
||||
& browser {
|
||||
|
@ -70,16 +74,9 @@
|
|||
margin-right: calc(-1 * var(--zen-split-column-gap));
|
||||
}
|
||||
|
||||
#tabbrowser-tabpanels:has(> [zen-split='true']),
|
||||
#zen-splitview-overlay {
|
||||
:root:not([zen-compact-mode='true']):not([customizing]) & {
|
||||
@media -moz-pref('zen.view.compact.hide-toolbar') {
|
||||
& {
|
||||
:root:not([customizing]) #zen-splitview-overlay {
|
||||
margin-top: calc(var(--zen-split-column-gap) * -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#tabbrowser-tabpanels[zen-split-view] {
|
||||
.zen-split-view-splitter {
|
||||
|
|
|
@ -634,13 +634,18 @@
|
|||
this.resetPinChangedUrl(tab);
|
||||
}
|
||||
|
||||
async getFaviconAsBase64(pageUrl) {
|
||||
async getFaviconAsBase64(pageUrl, secondTry = false) {
|
||||
try {
|
||||
const faviconData = await PlacesUtils.favicons.getFaviconForPage(pageUrl);
|
||||
if (!faviconData) {
|
||||
if (secondTry || pageUrl.spec.startsWith('about:')) {
|
||||
// empty favicon
|
||||
return 'data:image/png;base64,';
|
||||
}
|
||||
// Try again with the domain
|
||||
const domainUrl = pageUrl.spec.substring(0, pageUrl.spec.indexOf('/'));
|
||||
return await this.getFaviconAsBase64(Services.io.newURI(domainUrl), true);
|
||||
}
|
||||
return faviconData.dataURI;
|
||||
} catch (ex) {
|
||||
console.error('Failed to get favicon:', ex);
|
||||
|
@ -662,7 +667,7 @@
|
|||
for (let i = 0; i < tabs.length; i++) {
|
||||
let tab = tabs[i];
|
||||
const section = gZenWorkspaces.getEssentialsSection(tab);
|
||||
if (section.children.length >= this.MAX_ESSENTIALS_TABS) {
|
||||
if (!this.canEssentialBeAdded(tab)) {
|
||||
movedAll = false;
|
||||
continue;
|
||||
}
|
||||
|
@ -794,7 +799,7 @@
|
|||
document.getElementById('context_zen-add-essential').hidden =
|
||||
contextTab.getAttribute('zen-essential') ||
|
||||
!!contextTab.group ||
|
||||
gBrowser._numZenEssentials >= this.MAX_ESSENTIALS_TABS;
|
||||
!this.canEssentialBeAdded(contextTab);
|
||||
document.getElementById('context_zen-remove-essential').hidden =
|
||||
!contextTab.getAttribute('zen-essential');
|
||||
document.getElementById('context_unpinTab').hidden =
|
||||
|
@ -1007,6 +1012,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
canEssentialBeAdded(tab) {
|
||||
return (
|
||||
!(
|
||||
(tab.getAttribute('usercontextid') || 0) !=
|
||||
gZenWorkspaces.getActiveWorkspaceFromCache().containerTabId &&
|
||||
gZenWorkspaces.containerSpecificEssentials
|
||||
) && gBrowser._numZenEssentials < this.MAX_ESSENTIALS_TABS
|
||||
);
|
||||
}
|
||||
|
||||
applyDragoverClass(event, draggedTab) {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
|
@ -1040,10 +1055,7 @@
|
|||
shouldAddDragOverElement = true;
|
||||
}
|
||||
} else if (essentialTabsTarget) {
|
||||
if (
|
||||
!draggedTab.hasAttribute('zen-essential') &&
|
||||
gBrowser._numZenEssentials < this.MAX_ESSENTIALS_TABS
|
||||
) {
|
||||
if (!draggedTab.hasAttribute('zen-essential') && this.canEssentialBeAdded(draggedTab)) {
|
||||
shouldAddDragOverElement = true;
|
||||
isVertical = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue