mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 875775 - Allow widgets created by createWidget to specify if they're removable or not. r=mconley
--HG-- extra : rebase_source : 317bb5500c18a38314e835fc78dbcb658620cae7
This commit is contained in:
parent
62a48e69ec
commit
7c39bcadda
@ -685,6 +685,7 @@ let CustomizableUIInternal = {
|
|||||||
if (aWidget.disabled) {
|
if (aWidget.disabled) {
|
||||||
node.setAttribute("disabled", true);
|
node.setAttribute("disabled", true);
|
||||||
}
|
}
|
||||||
|
node.setAttribute("removable", aWidget.removable);
|
||||||
node.setAttribute("label", aWidget.name);
|
node.setAttribute("label", aWidget.name);
|
||||||
node.setAttribute("tooltiptext", aWidget.description);
|
node.setAttribute("tooltiptext", aWidget.description);
|
||||||
//XXXunf Need to hook this up to a <key> element or something.
|
//XXXunf Need to hook this up to a <key> element or something.
|
||||||
@ -1170,7 +1171,7 @@ let CustomizableUIInternal = {
|
|||||||
|
|
||||||
createBuiltinWidget: function(aData) {
|
createBuiltinWidget: function(aData) {
|
||||||
// This should only ever be called on startup, before any windows are
|
// This should only ever be called on startup, before any windows are
|
||||||
// openned - so we know there's no build areas to handle. Also, builtin
|
// opened - so we know there's no build areas to handle. Also, builtin
|
||||||
// widgets are expected to be (mostly) static, so shouldn't affect the
|
// widgets are expected to be (mostly) static, so shouldn't affect the
|
||||||
// current placement settings.
|
// current placement settings.
|
||||||
let widget = this.normalizeWidget(aData, CustomizableUI.SOURCE_BUILTIN);
|
let widget = this.normalizeWidget(aData, CustomizableUI.SOURCE_BUILTIN);
|
||||||
@ -1197,6 +1198,7 @@ let CustomizableUIInternal = {
|
|||||||
source: aSource || "addon",
|
source: aSource || "addon",
|
||||||
instances: new Map(),
|
instances: new Map(),
|
||||||
currentArea: null,
|
currentArea: null,
|
||||||
|
removable: false,
|
||||||
defaultArea: null,
|
defaultArea: null,
|
||||||
allowedAreas: [],
|
allowedAreas: [],
|
||||||
shortcut: null,
|
shortcut: null,
|
||||||
@ -1224,6 +1226,10 @@ let CustomizableUIInternal = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("removable" in aData && typeof aData.removable == "boolean") {
|
||||||
|
widget.removable = aData.removable;
|
||||||
|
}
|
||||||
|
|
||||||
if (aData.defaultArea && gAreas.has(aData.defaultArea)) {
|
if (aData.defaultArea && gAreas.has(aData.defaultArea)) {
|
||||||
widget.defaultArea = aData.defaultArea;
|
widget.defaultArea = aData.defaultArea;
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ const CustomizableWidgets = [{
|
|||||||
viewId: "PanelUI-history",
|
viewId: "PanelUI-history",
|
||||||
name: "History...",
|
name: "History...",
|
||||||
description: "History",
|
description: "History",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL, CustomizableUI.AREA_NAVBAR],
|
allowedAreas: [CustomizableUI.AREA_PANEL, CustomizableUI.AREA_NAVBAR],
|
||||||
icons: {
|
icons: {
|
||||||
@ -103,6 +104,7 @@ const CustomizableWidgets = [{
|
|||||||
id: "privatebrowsing-button",
|
id: "privatebrowsing-button",
|
||||||
name: "Private Browsing\u2026",
|
name: "Private Browsing\u2026",
|
||||||
description: "Open a new Private Browsing window",
|
description: "Open a new Private Browsing window",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL],
|
allowedAreas: [CustomizableUI.AREA_PANEL],
|
||||||
icons: {
|
icons: {
|
||||||
@ -123,6 +125,7 @@ const CustomizableWidgets = [{
|
|||||||
name: "Save Page",
|
name: "Save Page",
|
||||||
shortcut: "Ctrl+S",
|
shortcut: "Ctrl+S",
|
||||||
description: "Save this page",
|
description: "Save this page",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL],
|
allowedAreas: [CustomizableUI.AREA_PANEL],
|
||||||
icons: {
|
icons: {
|
||||||
@ -143,6 +146,7 @@ const CustomizableWidgets = [{
|
|||||||
name: "Find",
|
name: "Find",
|
||||||
shortcut: "Ctrl+F",
|
shortcut: "Ctrl+F",
|
||||||
description: "Find in this page",
|
description: "Find in this page",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL],
|
allowedAreas: [CustomizableUI.AREA_PANEL],
|
||||||
icons: {
|
icons: {
|
||||||
@ -163,6 +167,7 @@ const CustomizableWidgets = [{
|
|||||||
name: "Open File",
|
name: "Open File",
|
||||||
shortcut: "Ctrl+O",
|
shortcut: "Ctrl+O",
|
||||||
description: "Open file",
|
description: "Open file",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL],
|
allowedAreas: [CustomizableUI.AREA_PANEL],
|
||||||
icons: {
|
icons: {
|
||||||
@ -183,6 +188,7 @@ const CustomizableWidgets = [{
|
|||||||
name: "Developer",
|
name: "Developer",
|
||||||
shortcut: "Shift+F11",
|
shortcut: "Shift+F11",
|
||||||
description: "Toggle Developer Tools",
|
description: "Toggle Developer Tools",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL],
|
allowedAreas: [CustomizableUI.AREA_PANEL],
|
||||||
icons: {
|
icons: {
|
||||||
@ -203,6 +209,7 @@ const CustomizableWidgets = [{
|
|||||||
name: "Add-ons",
|
name: "Add-ons",
|
||||||
shortcut: "Ctrl+Shift+A",
|
shortcut: "Ctrl+Shift+A",
|
||||||
description: "Add-ons Manager",
|
description: "Add-ons Manager",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL],
|
allowedAreas: [CustomizableUI.AREA_PANEL],
|
||||||
icons: {
|
icons: {
|
||||||
@ -223,6 +230,7 @@ const CustomizableWidgets = [{
|
|||||||
name: "Preferences",
|
name: "Preferences",
|
||||||
shortcut: "Ctrl+Shift+O",
|
shortcut: "Ctrl+Shift+O",
|
||||||
description: "Preferences\u2026",
|
description: "Preferences\u2026",
|
||||||
|
removable: true,
|
||||||
defaultArea: CustomizableUI.AREA_PANEL,
|
defaultArea: CustomizableUI.AREA_PANEL,
|
||||||
allowedAreas: [CustomizableUI.AREA_PANEL],
|
allowedAreas: [CustomizableUI.AREA_PANEL],
|
||||||
icons: {
|
icons: {
|
||||||
|
Loading…
Reference in New Issue
Block a user