summaryrefslogtreecommitdiff
path: root/toolkit/content/widgets
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2022-04-26 10:13:11 -0500
committerBrian Smith <brian@dbsoft.org>2022-04-26 10:19:04 -0500
commit3daf711085889bad1bd68651bc4e8790412ae105 (patch)
treef5b0e4c1befb320cdf158e1839ac5e273373087f /toolkit/content/widgets
parent7fe702603066e7f122d5dd66a3a1892ac7e06215 (diff)
downloaduxp-3daf711085889bad1bd68651bc4e8790412ae105.tar.gz
Issue #1829 - Revert “Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.”
This also removes some PP abuse and takes file entries out of PP when no longer needed without XP_MACOSX conditionals. This reverts commit 6f707bde95dab6998ac204f9ee6c925ee230c740.
Diffstat (limited to 'toolkit/content/widgets')
-rw-r--r--toolkit/content/widgets/dialog.xml4
-rw-r--r--toolkit/content/widgets/findbar.xml33
-rw-r--r--toolkit/content/widgets/optionsDialog.xml11
-rw-r--r--toolkit/content/widgets/preferences.xml4
-rw-r--r--toolkit/content/widgets/tree.xml6
-rw-r--r--toolkit/content/widgets/wizard.xml49
6 files changed, 105 insertions, 2 deletions
diff --git a/toolkit/content/widgets/dialog.xml b/toolkit/content/widgets/dialog.xml
index aff1621965..d83570ac0f 100644
--- a/toolkit/content/widgets/dialog.xml
+++ b/toolkit/content/widgets/dialog.xml
@@ -422,11 +422,15 @@
if (!event.defaultPrevented)
this.cancelDialog();
</handler>
+#ifdef XP_MACOSX
+ <handler event="keypress" key="." modifiers="meta" phase="capturing" action="this.cancelDialog();"/>
+#else
<handler event="focus" phase="capturing">
var btn = this.getButton(this.defaultButton);
if (btn)
btn.setAttribute("default", event.originalTarget == btn || !(event.originalTarget instanceof Components.interfaces.nsIDOMXULButtonElement));
</handler>
+#endif
</handlers>
</binding>
diff --git a/toolkit/content/widgets/findbar.xml b/toolkit/content/widgets/findbar.xml
index aae799554d..c312a6a25a 100644
--- a/toolkit/content/widgets/findbar.xml
+++ b/toolkit/content/widgets/findbar.xml
@@ -1232,6 +1232,39 @@
]]></body>
</method>
+#ifdef XP_MACOSX
+ <!--
+ - Fetches the currently selected text and sets that as the text to search
+ - next. This is a MacOS specific feature.
+ -->
+ <method name="onFindSelectionCommand">
+ <body><![CDATA[
+ let searchString = this.browser.finder.setSearchStringToSelection();
+ if (searchString)
+ this._findField.value = searchString;
+ ]]></body>
+ </method>
+
+ <method name="_onFindFieldFocus">
+ <body><![CDATA[
+ let prefsvc = this._prefsvc;
+ const kPref = "accessibility.typeaheadfind.prefillwithselection";
+ if (this.prefillWithSelection && prefsvc.getBoolPref(kPref))
+ return;
+
+ let clipboardSearchString = this._browser.finder.clipboardSearchString;
+ if (clipboardSearchString && this._findField.value != clipboardSearchString &&
+ !this._findField._willfullyDeleted) {
+ this._findField.value = clipboardSearchString;
+ this._findField._hadValue = true;
+ // Changing the search string makes the previous status invalid, so
+ // we better clear it here.
+ this._updateStatusUI();
+ }
+ ]]></body>
+ </method>
+#endif
+
<!--
- This handles all the result changes for both
- type-ahead-find and highlighting.
diff --git a/toolkit/content/widgets/optionsDialog.xml b/toolkit/content/widgets/optionsDialog.xml
index efd20663e5..f0cdba62f2 100644
--- a/toolkit/content/widgets/optionsDialog.xml
+++ b/toolkit/content/widgets/optionsDialog.xml
@@ -11,6 +11,7 @@
<binding id="optionsDialog"
extends="chrome://global/content/bindings/dialog.xml#dialog">
<content>
+#ifndef XP_MACOSX
<xul:hbox flex="1">
<xul:categoryBox anonid="prefsCategories">
<children/>
@@ -20,6 +21,16 @@
<xul:iframe anonid="panelFrame" name="panelFrame" style="width: 0px;" flex="1"/>
</xul:vbox>
</xul:hbox>
+#else
+ <xul:vbox flex="1">
+ <xul:categoryBox anonid="prefsCategories">
+ <children/>
+ </xul:categoryBox>
+ <xul:vbox flex="1">
+ <xul:iframe anonid="panelFrame" name="panelFrame" style="width: 0px;" flex="1"/>
+ </xul:vbox>
+ </xul:vbox>
+#endif
</content>
<implementation>
diff --git a/toolkit/content/widgets/preferences.xml b/toolkit/content/widgets/preferences.xml
index f7cb109488..11de032462 100644
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -1146,7 +1146,11 @@
</handler>
<handler event="keypress"
+#ifdef XP_MACOSX
+ key="&openHelpMac.commandkey;" modifiers="accel"
+#else
keycode="&openHelp.commandkey;"
+#endif
phase="capturing">
<![CDATA[
var helpButton = this.getButton("help");
diff --git a/toolkit/content/widgets/tree.xml b/toolkit/content/widgets/tree.xml
index 19a1fa7727..aa17172575 100644
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -79,11 +79,11 @@
<property name="treeBoxObject"
onget="return this.boxObject;"
readonly="true"/>
-<!-- contentView is obsolete (see bug 202391) -->
+# contentView is obsolete (see bug 202391)
<property name="contentView"
onget="return this.view; /*.QueryInterface(Components.interfaces.nsITreeContentView)*/"
readonly="true"/>
-<!-- builderView is obsolete (see bug 202393) -->
+# builderView is obsolete (see bug 202393)
<property name="builderView"
onget="return this.view; /*.QueryInterface(Components.interfaces.nsIXULTreeBuilder)*/"
readonly="true"/>
@@ -774,6 +774,7 @@
event.preventDefault();
}
</handler>
+#ifndef XP_MACOSX
<!-- Use F2 key to enter text editing. -->
<handler event="keydown" keycode="VK_F2">
<![CDATA[
@@ -785,6 +786,7 @@
event.preventDefault();
]]>
</handler>
+#endif // XP_MACOSX
<handler event="keydown" keycode="VK_ESCAPE">
<![CDATA[
diff --git a/toolkit/content/widgets/wizard.xml b/toolkit/content/widgets/wizard.xml
index eb812f0652..3a8ec2cfef 100644
--- a/toolkit/content/widgets/wizard.xml
+++ b/toolkit/content/widgets/wizard.xml
@@ -465,6 +465,54 @@
</implementation>
</binding>
+#ifdef XP_MACOSX
+ <binding id="wizard-header" extends="chrome://global/content/bindings/wizard.xml#wizard-base">
+ <content>
+ <xul:stack class="wizard-header-stack" flex="1">
+ <xul:vbox class="wizard-header-box-1">
+ <xul:vbox class="wizard-header-box-text">
+ <xul:label class="wizard-header-label" xbl:inherits="xbl:text=label"/>
+ </xul:vbox>
+ </xul:vbox>
+ <xul:hbox class="wizard-header-box-icon">
+ <xul:spacer flex="1"/>
+ <xul:image class="wizard-header-icon" xbl:inherits="src=iconsrc"/>
+ </xul:hbox>
+ </xul:stack>
+ </content>
+ </binding>
+
+ <binding id="wizard-buttons" extends="chrome://global/content/bindings/wizard.xml#wizard-base">
+ <content>
+ <xul:vbox flex="1">
+ <xul:hbox class="wizard-buttons-btm">
+ <xul:button class="wizard-button" dlgtype="extra1" hidden="true"/>
+ <xul:button class="wizard-button" dlgtype="extra2" hidden="true"/>
+ <xul:button label="&button-cancel-mac.label;" class="wizard-button" dlgtype="cancel"/>
+ <xul:spacer flex="1"/>
+ <xul:button label="&button-back-mac.label;" accesskey="&button-back-mac.accesskey;"
+ class="wizard-button wizard-nav-button" dlgtype="back"/>
+ <xul:button label="&button-next-mac.label;" accesskey="&button-next-mac.accesskey;"
+ class="wizard-button wizard-nav-button" dlgtype="next"
+ default="true" xbl:inherits="hidden=lastpage" />
+ <xul:button label="&button-finish-mac.label;" class="wizard-button"
+ dlgtype="finish" default="true" xbl:inherits="hidden=hidefinishbutton" />
+ </xul:hbox>
+ </xul:vbox>
+ </content>
+
+ <implementation>
+ <method name="onPageChange">
+ <body><![CDATA[
+ this.setAttribute("hidefinishbutton", !(this.getAttribute("lastpage") == "true"));
+ ]]></body>
+ </method>
+ </implementation>
+
+ </binding>
+
+#else
+
<binding id="wizard-header" extends="chrome://global/content/bindings/wizard.xml#wizard-base">
<content>
<xul:hbox class="wizard-header-box-1" flex="1">
@@ -554,5 +602,6 @@
</property>
</implementation>
</binding>
+#endif
</bindings>