mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 01:16:35 +00:00
feat: update preferences and UI components for new features and improvements
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||
index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded349732ffc6 100644
|
||||
index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..6a68b53443d32461927ef98d770b297caaecf790 100644
|
||||
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
@@ -90,7 +90,27 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
} else {
|
||||
window.gNavToolbox.palette.appendChild(widgetNode);
|
||||
}
|
||||
@@ -2678,7 +2677,6 @@ var CustomizableUIInternal = {
|
||||
@@ -1704,16 +1703,16 @@ var CustomizableUIInternal = {
|
||||
elem.setAttribute("skipintoolbarset", "true");
|
||||
}
|
||||
}
|
||||
-
|
||||
+ ZenCustomizableUI.init(window);
|
||||
// Now register all the toolbars
|
||||
for (let area of CustomizableUI.areas) {
|
||||
let type = CustomizableUI.getAreaType(area);
|
||||
- if (type == CustomizableUI.TYPE_TOOLBAR) {
|
||||
+ if (type == CustomizableUI.TYPE_TOOLBAR && !area.startsWith("zen-")) {
|
||||
let node = document.getElementById(area);
|
||||
this.registerToolbarNode(node);
|
||||
}
|
||||
}
|
||||
-
|
||||
+ ZenCustomizableUI.registerToolbarNodes(window);
|
||||
// Handle initial state of vertical tabs.
|
||||
if (isVerticalTabs) {
|
||||
// Show the vertical tabs toolbar
|
||||
@@ -2744,7 +2743,6 @@ var CustomizableUIInternal = {
|
||||
if (!this.isWidgetRemovable(aWidgetId)) {
|
||||
return;
|
||||
}
|
||||
@@ -98,7 +118,7 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
let placements = gPlacements.get(oldPlacement.area);
|
||||
let position = placements.indexOf(aWidgetId);
|
||||
if (position != -1) {
|
||||
@@ -3669,7 +3667,7 @@ var CustomizableUIInternal = {
|
||||
@@ -3735,7 +3733,7 @@ var CustomizableUIInternal = {
|
||||
}
|
||||
},
|
||||
|
||||
@@ -107,7 +127,7 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
for (let [areaId, areaNodes] of gBuildAreas) {
|
||||
let placements = gPlacements.get(areaId);
|
||||
let isFirstChangedToolbar = true;
|
||||
@@ -3680,7 +3678,7 @@ var CustomizableUIInternal = {
|
||||
@@ -3746,7 +3744,7 @@ var CustomizableUIInternal = {
|
||||
if (area.get("type") == CustomizableUI.TYPE_TOOLBAR) {
|
||||
let defaultCollapsed = area.get("defaultCollapsed");
|
||||
let win = areaNode.ownerGlobal;
|
||||
@@ -116,7 +136,7 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
win.setToolbarVisibility(
|
||||
areaNode,
|
||||
typeof defaultCollapsed == "string"
|
||||
@@ -4857,6 +4855,7 @@ export var CustomizableUI = {
|
||||
@@ -4923,6 +4921,7 @@ export var CustomizableUI = {
|
||||
unregisterArea(aName, aDestroyPlacements) {
|
||||
CustomizableUIInternal.unregisterArea(aName, aDestroyPlacements);
|
||||
},
|
||||
@@ -124,7 +144,7 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
/**
|
||||
* Add a widget to an area.
|
||||
* If the area to which you try to add is not known to CustomizableUI,
|
||||
@@ -6840,11 +6839,11 @@ class OverflowableToolbar {
|
||||
@@ -6916,11 +6915,11 @@ class OverflowableToolbar {
|
||||
parseFloat(style.paddingLeft) -
|
||||
parseFloat(style.paddingRight) -
|
||||
toolbarChildrenWidth;
|
||||
@@ -138,7 +158,7 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
});
|
||||
|
||||
lazy.log.debug(
|
||||
@@ -6854,7 +6853,8 @@ class OverflowableToolbar {
|
||||
@@ -6930,7 +6929,8 @@ class OverflowableToolbar {
|
||||
// If the target has min-width: 0, their children might actually overflow
|
||||
// it, so check for both cases explicitly.
|
||||
let targetContentWidth = Math.max(targetWidth, targetChildrenWidth);
|
||||
@@ -148,7 +168,7 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
return { isOverflowing, targetContentWidth, totalAvailWidth };
|
||||
}
|
||||
|
||||
@@ -6948,7 +6948,7 @@ class OverflowableToolbar {
|
||||
@@ -7024,7 +7024,7 @@ class OverflowableToolbar {
|
||||
}
|
||||
}
|
||||
if (!inserted) {
|
||||
@@ -157,7 +177,7 @@ index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded34
|
||||
}
|
||||
child.removeAttribute("cui-anchorid");
|
||||
child.removeAttribute("overflowedItem");
|
||||
@@ -7110,6 +7110,9 @@ class OverflowableToolbar {
|
||||
@@ -7186,6 +7186,9 @@ class OverflowableToolbar {
|
||||
* @param {MouseEvent} aEvent the click event.
|
||||
*/
|
||||
#onClickDefaultListButton(aEvent) {
|
||||
|
@@ -1,22 +1,13 @@
|
||||
diff --git a/browser/components/customizableui/ToolbarContextMenu.sys.mjs b/browser/components/customizableui/ToolbarContextMenu.sys.mjs
|
||||
index 9879487f9ed9ddf825f5fb5c1467ddbd7fbe7a32..9e2565fafe0f5f9afa6065c9f4f522fec745db2a 100644
|
||||
index af22f766a052372a68faca139161cccbf0d768f0..ceff0576321f880c71ce301e537f4d03ccca8a73 100644
|
||||
--- a/browser/components/customizableui/ToolbarContextMenu.sys.mjs
|
||||
+++ b/browser/components/customizableui/ToolbarContextMenu.sys.mjs
|
||||
@@ -237,17 +237,6 @@ export var ToolbarContextMenu = {
|
||||
// autohide item's checked state to mirror the autohide pref.
|
||||
showFullScreenViewContextMenuItems(popup);
|
||||
|
||||
- let toggleVerticalTabsItem = document.getElementById(
|
||||
- "toolbar-context-toggle-vertical-tabs"
|
||||
- );
|
||||
- document.l10n.setAttributes(
|
||||
- toggleVerticalTabsItem,
|
||||
- gBrowser.tabContainer?.verticalMode
|
||||
- ? "toolbar-context-turn-off-vertical-tabs"
|
||||
- : "toolbar-context-turn-on-vertical-tabs"
|
||||
- );
|
||||
- document.getElementById("toolbar-context-customize-sidebar").hidden =
|
||||
- !gBrowser.tabContainer?.verticalMode;
|
||||
|
||||
// View -> Toolbars menu doesn't have the moveToPanel or removeFromToolbar items.
|
||||
if (!moveToPanel || !removeFromToolbar) {
|
||||
@@ -241,7 +241,7 @@ export var ToolbarContextMenu = {
|
||||
let sidebarRevampEnabled = Services.prefs.getBoolPref("sidebar.revamp");
|
||||
let showSidebarActions =
|
||||
["tabbrowser-tabs", "sidebar-button"].includes(toolbarItem?.id) ||
|
||||
- toolbarItem?.localName == "toolbarspring";
|
||||
+ toolbarItem?.localName == "toolbarspring" && false;
|
||||
let toggleVerticalTabsItem = document.getElementById(
|
||||
"toolbar-context-toggle-vertical-tabs"
|
||||
);
|
||||
|
Reference in New Issue
Block a user