mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 09:26:34 +00:00
feat: Add Essentials Toolbar
This commit introduces a new Essentials Toolbar feature to Zen. It provides a more streamlined and organized way for users to access frequently used bookmakrs directly from the sidebar. - Added `ZenEssentialsToolbar.mjs` to provide the logic for the toolbar. - Updated the sidebar CSS (`zen-sidebar.css`) to style the Essentials Toolbar. - Modified `ZenStartup.mjs` to initialize the Essentials Toolbar. - Made changes to `browserPlacesViews-js.patch` to integrate with existing bookmark functionality. - Added a new preference `zen.essentials.enabled` to enable/disable the Essentials Toolbar.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js
|
||||
index 1bfa0af16178c9b42172bc1b1e0249d28ff8e9e6..e7e76a6d548b32887c1d39053e42c5e3dafbb839 100644
|
||||
--- a/browser/components/places/content/browserPlacesViews.js
|
||||
+++ b/browser/components/places/content/browserPlacesViews.js
|
||||
@@ -393,6 +393,7 @@ class PlacesViewBase {
|
||||
"scheme",
|
||||
PlacesUIUtils.guessUrlSchemeForUI(aPlacesNode.uri)
|
||||
);
|
||||
+ element.addEventListener("command", gZenGlanceManager.openGlanceForBookmark.bind(gZenGlanceManager));
|
||||
} else if (PlacesUtils.containerTypes.includes(type)) {
|
||||
element = document.createXULElement("menu");
|
||||
element.setAttribute("container", "true");
|
||||
@@ -1087,6 +1088,8 @@ class PlacesToolbar extends PlacesViewBase {
|
||||
"scheme",
|
||||
PlacesUIUtils.guessUrlSchemeForUI(aChild.uri)
|
||||
);
|
||||
+ button.hidden = ZenWorkspaces.isBookmarkInAnotherWorkspace(aChild);
|
||||
+ button.addEventListener("command", gZenGlanceManager.openGlanceForBookmark.bind(gZenGlanceManager));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2235,7 +2238,7 @@ this.PlacesPanelview = class PlacesPanelview extends PlacesViewBase {
|
||||
PlacesUIUtils.guessUrlSchemeForUI(placesNode.uri)
|
||||
);
|
||||
element.setAttribute("label", PlacesUIUtils.getBestTitle(placesNode));
|
||||
-
|
||||
+ element.addEventListener("command", gZenGlanceManager.openGlanceForBookmark.bind(gZenGlanceManager));
|
||||
let icon = placesNode.icon;
|
||||
if (icon) {
|
||||
element.setAttribute("image", icon);
|
@@ -1099,5 +1099,10 @@ Preferences.addAll([
|
||||
id: "zen.view.compact.color-sidebar",
|
||||
type: "bool",
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
id: "zen.essentials.enabled",
|
||||
type: "bool",
|
||||
default: true,
|
||||
}
|
||||
]);
|
||||
|
Reference in New Issue
Block a user