зеркало из https://github.com/mozilla/pjs.git
bug 213228: new toolkit independence bug, part 2.
bind our dialog.xml and wizard.xml widgets. remove the need for platformXUL.css and platformDialog.xml sync dialog.xml (bug 197568, patch by ajvincent@juno.com) with seamonkey
This commit is contained in:
Родитель
b2257db2ca
Коммит
bb45ab8d40
|
@ -17,14 +17,26 @@
|
|||
<children/>
|
||||
</xul:vbox>
|
||||
|
||||
<xul:hbox class="dialog-button-box" pack="end" anonid="buttons"
|
||||
xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient">
|
||||
<xul:hbox class="dialog-button-box" anonid="buttons"
|
||||
xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient"
|
||||
#ifdef XP_MACOSX
|
||||
>
|
||||
<xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
|
||||
<xul:button dlgtype="help" class="dialog-button" hidden="true"/>
|
||||
<xul:button dlgtype="extra2" class="dialog-button" hidden="true" label=""/>
|
||||
<xul:button dlgtype="extra1" class="dialog-button" hidden="true" label=""/>
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:button dlgtype="cancel" class="dialog-button"/>
|
||||
<xul:button dlgtype="accept" class="dialog-button"/>
|
||||
#else
|
||||
pack="end">
|
||||
<xul:button dlgtype="accept" class="dialog-button"/>
|
||||
<xul:button dlgtype="extra1" class="dialog-button" hidden="true" label=""/>
|
||||
<xul:button dlgtype="extra2" class="dialog-button" hidden="true" label=""/>
|
||||
<xul:button dlgtype="cancel" class="dialog-button"/>
|
||||
<xul:button dlgtype="help" class="dialog-button" hidden="true"/>
|
||||
<xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
|
||||
#endif
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
||||
|
@ -34,7 +46,13 @@
|
|||
if (!document.documentElement.cancelDialog())
|
||||
event.preventDefault();
|
||||
})</field>
|
||||
<field name="enterDefaultAlways">false</field>
|
||||
<field name="enterDefaultAlways">
|
||||
#ifdef XP_MACOSX
|
||||
true
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
</field>
|
||||
|
||||
<property name="buttons"
|
||||
onget="return this.getAttribute('buttons');"
|
||||
|
@ -290,8 +308,13 @@
|
|||
</method>
|
||||
|
||||
<method name="_hitEnter">
|
||||
<parameter name="evt"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var target = evt.originalTarget;
|
||||
if ((target.localName == "textarea")&&(target.namespaceURI == "http://www.w3.org/1999/xhtml")) {
|
||||
return;
|
||||
}
|
||||
// if a button is focused, do nothing, so that activating the button
|
||||
// doesn't cause the dialog to exit
|
||||
if (!this.enterDefaultAlways) {
|
||||
|
@ -311,9 +334,12 @@
|
|||
</implementation>
|
||||
|
||||
<handlers>
|
||||
<handler event="keypress" keycode="VK_ENTER" action="this._hitEnter();"/>
|
||||
<handler event="keypress" keycode="VK_RETURN" action="this._hitEnter();"/>
|
||||
<handler event="keypress" keycode="VK_ENTER" action="this._hitEnter(event);"/>
|
||||
<handler event="keypress" keycode="VK_RETURN" action="this._hitEnter(event);"/>
|
||||
<handler event="keypress" keycode="VK_ESCAPE" action="this.cancelDialog();"/>
|
||||
#ifdef XP_MACOSX
|
||||
<handler event="keypress" key="." modifiers="meta" phase="capturing" action="this.cancelDialog();"/>
|
||||
#endif
|
||||
</handlers>
|
||||
|
||||
</binding>
|
||||
|
|
|
@ -405,6 +405,57 @@
|
|||
</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-2">
|
||||
<xul:vbox class="wizard-header-box-text">
|
||||
<xul:label class="wizard-header-label" xbl:inherits="value=label"/>
|
||||
</xul:vbox>
|
||||
</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-top" xbl:inherits="hidden=hidetoprow">
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:button class="wizard-button" dlgtype="cancel"/>
|
||||
<xul:button class="wizard-button" dlgtype="finish" default="true"/>
|
||||
</xul:hbox>
|
||||
<xul:separator class="wizard-buttons-separator groove"/>
|
||||
<xul:hbox class="wizard-buttons-btm">
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:button class="wizard-button wizard-nav-button" dlgtype="back"/>
|
||||
<xul:hbox class="wizard-label-box" align="center">
|
||||
<xul:label class="wizard-page-label" xbl:inherits="value=pagestep"/>
|
||||
</xul:hbox>
|
||||
<xul:button class="wizard-button wizard-nav-button" dlgtype="next" default="true" xbl:inherits="disabled=lastpage"/>
|
||||
</xul:hbox>
|
||||
</xul:vbox>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<method name="onPageChange">
|
||||
<body><![CDATA[
|
||||
this.setAttribute("hidetoprow", !(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">
|
||||
|
@ -453,53 +504,6 @@
|
|||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="wizard-header-mac" 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-2">
|
||||
<xul:vbox class="wizard-header-box-text">
|
||||
<xul:label class="wizard-header-label" xbl:inherits="value=label"/>
|
||||
</xul:vbox>
|
||||
</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-mac" extends="chrome://global/content/bindings/wizard.xml#wizard-base">
|
||||
<content>
|
||||
<xul:vbox flex="1">
|
||||
<xul:hbox class="wizard-buttons-top" xbl:inherits="hidden=hidetoprow">
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:button class="wizard-button" dlgtype="cancel"/>
|
||||
<xul:button class="wizard-button" dlgtype="finish" default="true"/>
|
||||
</xul:hbox>
|
||||
<xul:separator class="wizard-buttons-separator groove"/>
|
||||
<xul:hbox class="wizard-buttons-btm">
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:button class="wizard-button wizard-nav-button" dlgtype="back"/>
|
||||
<xul:hbox class="wizard-label-box" align="center">
|
||||
<xul:label class="wizard-page-label" xbl:inherits="value=pagestep"/>
|
||||
</xul:hbox>
|
||||
<xul:button class="wizard-button wizard-nav-button" dlgtype="next" default="true" xbl:inherits="disabled=lastpage"/>
|
||||
</xul:hbox>
|
||||
</xul:vbox>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<method name="onPageChange">
|
||||
<body><![CDATA[
|
||||
this.setAttribute("hidetoprow", !(this.getAttribute("lastpage") == "true"));
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
</binding>
|
||||
#endif
|
||||
|
||||
</bindings>
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
CHANGES REVIEWED BY hyatt@netscape.com.
|
||||
**/
|
||||
|
||||
@import url("chrome://global/content/platformXUL.css");
|
||||
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
|
||||
@namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
|
||||
@namespace xbl url("http://www.mozilla.org/xbl"); /* namespace for XBL elements */
|
||||
|
@ -208,6 +206,13 @@ toolbar {
|
|||
-moz-binding: url("chrome://global/content/widgets/toolbar.xml#toolbar");
|
||||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
toolbar[type="menubar"] {
|
||||
min-height: 0 !important;
|
||||
border: 0 !important;
|
||||
}
|
||||
#endif
|
||||
|
||||
toolbarseparator {
|
||||
-moz-binding: url("chrome://global/content/widgets/toolbar.xml#toolbardecoration");
|
||||
}
|
||||
|
@ -310,9 +315,15 @@ tooltip {
|
|||
margin-top: 21px;
|
||||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
.statusbar-resizerpanel {
|
||||
display: none;
|
||||
}
|
||||
#else
|
||||
window[sizemode="maximized"] statusbarpanel.statusbar-resizerpanel {
|
||||
visibility: collapse;
|
||||
}
|
||||
#endif
|
||||
|
||||
/********** floating popups **********/
|
||||
|
||||
|
@ -814,6 +825,9 @@ autorepeatbutton {
|
|||
statusbar
|
||||
{
|
||||
-moz-binding: url("chrome://global/content/widgets/general.xml#statusbar");
|
||||
#ifdef XP_MACOSX
|
||||
padding-right: 14px;
|
||||
#endif
|
||||
}
|
||||
|
||||
statusbarpanel {
|
||||
|
@ -849,12 +863,12 @@ stringbundle {
|
|||
/********** dialog **********/
|
||||
|
||||
dialog {
|
||||
-moz-binding: url("chrome://global/content/bindings/dialog.xml#dialog");
|
||||
-moz-binding: url("chrome://global/content/widgets/dialog.xml#dialog");
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
dialogheader {
|
||||
-moz-binding: url("chrome://global/content/bindings/dialog.xml#dialogheader");
|
||||
-moz-binding: url("chrome://global/content/widgets/dialog.xml#dialogheader");
|
||||
}
|
||||
|
||||
/********* page ************/
|
||||
|
@ -866,22 +880,22 @@ page {
|
|||
/********** wizard **********/
|
||||
|
||||
wizard {
|
||||
-moz-binding: url("chrome://global/content/bindings/wizard.xml#wizard");
|
||||
-moz-binding: url("chrome://global/content/widgets/wizard.xml#wizard");
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
wizardpage {
|
||||
-moz-binding: url("chrome://global/content/bindings/wizard.xml#wizardpage");
|
||||
-moz-binding: url("chrome://global/content/widgets/wizard.xml#wizardpage");
|
||||
-moz-box-orient: vertical;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.wizard-header {
|
||||
-moz-binding: url("chrome://global/content/bindings/wizard.xml#wizard-header");
|
||||
-moz-binding: url("chrome://global/content/widgets/wizard.xml#wizard-header");
|
||||
}
|
||||
|
||||
.wizard-buttons {
|
||||
-moz-binding: url("chrome://global/content/bindings/wizard.xml#wizard-buttons");
|
||||
-moz-binding: url("chrome://global/content/widgets/wizard.xml#wizard-buttons");
|
||||
}
|
||||
|
||||
/********** expander ********/
|
||||
|
|
|
@ -23,7 +23,7 @@ toolkit.jar:
|
|||
content/global/widgets/toolbar.xml (content/widgets/toolbar.xml)
|
||||
content/global/widgets/toolbarbutton.xml (content/widgets/toolbarbutton.xml)
|
||||
content/global/widgets/colorpicker.xml (content/widgets/colorpicker.xml)
|
||||
content/global/widgets/dialog.xml (content/widgets/dialog.xml)
|
||||
* content/global/widgets/dialog.xml (content/widgets/dialog.xml)
|
||||
content/global/widgets/general.xml (content/widgets/general.xml)
|
||||
content/global/widgets/groupbox.xml (content/widgets/groupbox.xml)
|
||||
content/global/widgets/listbox.xml (content/widgets/listbox.xml)
|
||||
|
@ -39,7 +39,7 @@ toolkit.jar:
|
|||
content/global/widgets/stringbundle.xml (content/widgets/stringbundle.xml)
|
||||
content/global/widgets/text.xml (content/widgets/text.xml)
|
||||
content/global/widgets/tree.xml (content/widgets/tree.xml)
|
||||
content/global/widgets/wizard.xml (content/widgets/wizard.xml)
|
||||
* content/global/widgets/wizard.xml (content/widgets/wizard.xml)
|
||||
content/global/widgets/autoscroll_all.png (content/widgets/autoscroll_all.png)
|
||||
content/global/widgets/autoscroll_h.png (content/widgets/autoscroll_h.png)
|
||||
content/global/widgets/autoscroll_v.png (content/widgets/autoscroll_v.png)
|
||||
|
|
Загрузка…
Ссылка в новой задаче