mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
God, I shoud've had never created compact mode
This commit is contained in:
@@ -94,6 +94,8 @@ var ZenWorkspaces = {
|
||||
}
|
||||
json.workspaces = json.workspaces.filter(workspace => workspace.uuid !== windowID);
|
||||
await IOUtils.writeJSON(this._storeFile, json);
|
||||
this._workspaceCache = null;
|
||||
await this._propagateWorkspaceData();
|
||||
},
|
||||
|
||||
async saveWorkspaces() {
|
||||
@@ -126,14 +128,30 @@ var ZenWorkspaces = {
|
||||
element.className = "subviewbutton";
|
||||
element.setAttribute("tooltiptext", workspace.name);
|
||||
element.setAttribute("zen-workspace-id", workspace.uuid);
|
||||
element.innerHTML = `
|
||||
let childs = window.MozXULElement.parseXULToFragment(`
|
||||
<div class="zen-workspace-icon">
|
||||
${workspace.name[0].toUpperCase()}
|
||||
</div>
|
||||
<div class="zen-workspace-name">
|
||||
${workspace.name}
|
||||
</div>
|
||||
`;
|
||||
<toolbarbutton closemenu="none" class="toolbarbutton-1 zen-workspace-actions">
|
||||
<image class="toolbarbutton-icon" id="zen-workspace-actions-menu-icon"></image>
|
||||
</toolbarbutton>
|
||||
`);
|
||||
childs.querySelector(".zen-workspace-actions").addEventListener("command", (event) => {
|
||||
event.stopPropagation();
|
||||
let button = event.target;
|
||||
const popup = button.ownerDocument.getElementById(
|
||||
"zenWorkspaceActionsMenu"
|
||||
);
|
||||
popup.openPopup(button, "after_end", 0,
|
||||
0,
|
||||
true /* isContextMenu */,
|
||||
false /* attributesOverride */,
|
||||
event);
|
||||
});
|
||||
element.appendChild(childs);
|
||||
element.onclick = (async () => {
|
||||
await this.changeWorkspace(workspace)
|
||||
let panel = document.getElementById("PanelUI-zen-workspaces");
|
||||
@@ -311,6 +329,23 @@ var ZenWorkspaces = {
|
||||
tab.setAttribute("zen-workspace-id", activeWorkspace.uuid);
|
||||
}
|
||||
},
|
||||
|
||||
// Context menu management
|
||||
|
||||
_contextMenuId: null,
|
||||
updateContextMenu(event) {
|
||||
event.preventDefault();
|
||||
let target = event.target;
|
||||
let workspace = target.closest("[zen-workspace-id]");
|
||||
if (!workspace) {
|
||||
return;
|
||||
}
|
||||
_contextMenuId = workspace.getAttribute("zen-workspace-id");
|
||||
},
|
||||
|
||||
contextDelete() {
|
||||
this.removeWorkspace(_contextMenuId);
|
||||
}
|
||||
};
|
||||
|
||||
ZenWorkspaces.init();
|
||||
|
@@ -111,4 +111,11 @@
|
||||
</html:moz-button-group>
|
||||
</panelview>
|
||||
</panelmultiview>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<menupopup id="zenWorkspaceActionsMenu"
|
||||
onpopupshowing="ZenWorkspaces.updateContextMenu(event);"
|
||||
onpopuphidden="ZenWorkspaces._contextMenuId = null;">
|
||||
<menuseparator/>
|
||||
<menuitem id="context_zenDeleteWorkspace" oncommand="ZenWorkspaces.contextDelete();" data-l10n-id="zen-workspaces-panel-context-delete"/>
|
||||
</menupopup>
|
@@ -11,3 +11,7 @@ zen-panel-ui-workspaces-create-save =
|
||||
zen-panel-ui-workspaces-create-cancel =
|
||||
.label = Cancel
|
||||
.accesskey = C
|
||||
|
||||
zen-workspaces-panel-context-delete =
|
||||
.label = Delete Workspace
|
||||
.accesskey = D
|
||||
|
@@ -472,53 +472,60 @@ panelmultiview {
|
||||
|
||||
@media (-moz-bool-pref: "zen.view.compact") {
|
||||
#navigator-toolbox,
|
||||
#zen-appcontent-navbar-container #PersonalToolbar {
|
||||
position: absolute;
|
||||
#zen-appcontent-navbar-container #nav-bar {
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
transition: .2s;
|
||||
}
|
||||
|
||||
#navigator-toolbox {
|
||||
width: 1px;
|
||||
max-width: 1px;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#zen-appcontent-navbar-container #PersonalToolbar {
|
||||
#zen-appcontent-navbar-container #nav-bar {
|
||||
min-height: 0;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#navigator-toolbox:hover,
|
||||
#navigator-toolbox:has([open="true"]) {
|
||||
width: unset;
|
||||
overflow: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#zen-appcontent-navbar-container #PersonalToolbar:hover,
|
||||
#zen-appcontent-navbar-container #PersonalToolbar:has([open="true"]) {
|
||||
height: unset;
|
||||
background: var(--zen-themed-toolbar-bg) !important;
|
||||
overflow: visible;
|
||||
border-bottom: var(--zen-appcontent-border) !important;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#navigator-toolbox:hover #titlebar,
|
||||
#navigator-toolbox:has([open="true"]:not(tab)) #titlebar {
|
||||
background: var(--zen-themed-toolbar-bg) !important;
|
||||
border-right: var(--zen-appcontent-border) !important;
|
||||
padding: 0 5px;
|
||||
max-height: 1px;
|
||||
}
|
||||
|
||||
#tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer {
|
||||
margin: 10px !important;
|
||||
margin-right: 0 !important;
|
||||
margin-top: 0 !important;
|
||||
width: -moz-available;
|
||||
}
|
||||
|
||||
:root:has(
|
||||
:is(
|
||||
#navigator-toolbox:hover,
|
||||
#navigator-toolbox *[open="true"],
|
||||
#zen-appcontent-navbar-container:hover,
|
||||
#zen-appcontent-navbar-container *[open="true"]
|
||||
)
|
||||
) {
|
||||
& #zen-appcontent-navbar-container #nav-bar,
|
||||
& #navigator-toolbox {
|
||||
max-width: unset;
|
||||
max-height: unset;
|
||||
overflow: visible;
|
||||
opacity: 1;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
& #navigator-toolbox {
|
||||
border-right: var(--zen-appcontent-border) !important;
|
||||
width: unset;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
& #zen-appcontent-navbar-container #nav-bar {
|
||||
border-bottom: var(--zen-appcontent-border) !important;
|
||||
}
|
||||
|
||||
& #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:root:is([chromehidden~="location"],[chromehidden~="toolbar"]) {
|
||||
|
@@ -81,7 +81,8 @@
|
||||
}
|
||||
|
||||
#PanelUI-menu-button,
|
||||
#appMenu-more-button2 {
|
||||
#appMenu-more-button2,
|
||||
#zen-workspace-actions-menu-icon {
|
||||
list-style-image: url("menu.svg") !important;
|
||||
}
|
||||
|
||||
@@ -668,7 +669,8 @@ menuitem[id="placesContext_deleteFolder"],
|
||||
menuitem[id="placesContext_delete"],
|
||||
menuitem[id="placesContext_delete_history"],
|
||||
menuitem[id="placesContext_deleteHost"],
|
||||
#context_zenDeleteWebPanel {
|
||||
#context_zenDeleteWebPanel,
|
||||
#context_zenDeleteWorkspace {
|
||||
--menu-image: url("edit-delete.svg");
|
||||
}
|
||||
|
||||
|
@@ -315,6 +315,11 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
& .zen-workspace-actions {
|
||||
margin: 0;
|
||||
margin-left: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
#PanelUI-zen-workspaces-current-info toolbarbutton:first-child {
|
||||
|
Reference in New Issue
Block a user