mirror of
https://github.com/zen-browser/desktop.git
synced 2026-07-21 08:01:06 +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) {
|
||||
|
||||
Reference in New Issue
Block a user