mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-07 05:43:21 +00:00
Update Zen Browser styles for dark mode compatibility
This commit is contained in:
@@ -39,7 +39,6 @@ if test "$ZEN_RELEASE"; then
|
||||
ac_add_options --disable-tests
|
||||
ac_add_options --enable-strip
|
||||
ac_add_options --enable-install-strip
|
||||
ac_add_options --enable-lto=full
|
||||
|
||||
ac_add_options --enable-rust-simd
|
||||
ac_add_options --disable-parental-controls
|
||||
|
||||
@@ -19,6 +19,7 @@ var gZenBrowserManagerSidebar = {
|
||||
this.update();
|
||||
this.close(); // avoid caching
|
||||
this.listenForPrefChanges();
|
||||
this.insertIntoContextMenu();
|
||||
},
|
||||
|
||||
get sidebarData() {
|
||||
@@ -231,6 +232,19 @@ var gZenBrowserManagerSidebar = {
|
||||
this._updateWebPanel();
|
||||
},
|
||||
|
||||
_createNewPanel(url) {
|
||||
let data = this.sidebarData;
|
||||
let newName = "p" + new Date().getTime();
|
||||
data.index.push(newName);
|
||||
data.data[newName] = {
|
||||
url: url,
|
||||
ua: false,
|
||||
};
|
||||
Services.prefs.setStringPref("zen.sidebar.data", JSON.stringify(data));
|
||||
this._currentPanel = newName;
|
||||
this.update();
|
||||
},
|
||||
|
||||
_updateButtons() {
|
||||
for (let button of this.sidebarElement.querySelectorAll(".zen-sidebar-panel-button")) {
|
||||
if (button.getAttribute("zen-sidebar-id") === this._currentPanel) {
|
||||
@@ -477,6 +491,21 @@ var gZenBrowserManagerSidebar = {
|
||||
browser.remove();
|
||||
this._closeSidebarPanel();
|
||||
},
|
||||
|
||||
insertIntoContextMenu() {
|
||||
const sibling = document.getElementById("context-stripOnShareLink");
|
||||
const menuitem = document.createXULElement("menuitem");
|
||||
menuitem.setAttribute("id", "context-zenAddToWebPanel");
|
||||
menuitem.setAttribute("hidden", "true");
|
||||
menuitem.setAttribute("oncommand", "gZenBrowserManagerSidebar.addPanelFromContextMenu();");
|
||||
menuitem.setAttribute("data-l10n-id", "zen-web-side-panel-context-add-to-panel");
|
||||
sibling.insertAdjacentElement("afterend", menuitem);
|
||||
},
|
||||
|
||||
addPanelFromContextMenu() {
|
||||
const url = gContextMenu.linkURL || gContextMenu.target.ownerDocument.location.href;
|
||||
this._createNewPanel(url);
|
||||
},
|
||||
};
|
||||
|
||||
gZenBrowserManagerSidebar.init();
|
||||
|
||||
16
src/browser/base/content/nsContextMenu-js.patch
Normal file
16
src/browser/base/content/nsContextMenu-js.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js
|
||||
index b5c8dd44daaab18397cf01d0ef9f5288f5113925..f59b494dc287edaa148f726902244224330d81c5 100644
|
||||
--- a/browser/base/content/nsContextMenu.js
|
||||
+++ b/browser/base/content/nsContextMenu.js
|
||||
@@ -1047,6 +1047,11 @@ class nsContextMenu {
|
||||
!this.isSecureAboutPage()
|
||||
);
|
||||
|
||||
+ this.showItem(
|
||||
+ "context-zenAddToWebPanel",
|
||||
+ this.onLink && !this.onMailtoLink && !this.onTelLink
|
||||
+ );
|
||||
+
|
||||
let copyLinkSeparator = document.getElementById("context-sep-copylink");
|
||||
// Show "Copy Link", "Copy" and "Copy Clean Link" with no divider, and "copy link" and "Send link to Device" with no divider between.
|
||||
// Other cases will show a divider.
|
||||
@@ -20,4 +20,9 @@ zen-web-side-panel-context-delete =
|
||||
.accesskey = D
|
||||
zen-web-side-panel-open-in-new-tab =
|
||||
.label = Open in New Tab
|
||||
.accesskey = N
|
||||
.accesskey = N
|
||||
|
||||
|
||||
zen-web-side-panel-context-add-to-panel =
|
||||
.label = Add to Web Panels
|
||||
.accesskey = A
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
list-style-image: url("sidebars-right.svg") !important;
|
||||
}
|
||||
|
||||
#context_zenSplitTabs {
|
||||
#context_zenSplitTabs,
|
||||
#context-zenAddToWebPanel {
|
||||
/* TODO: Add split view icon */
|
||||
--menu-image: url("sidebars-right.svg") !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user