зеркало из https://github.com/mozilla/gecko-dev.git
Bug 98595 Ability to disable lists/trees/outliners completely Toolkit verison of patch v0.3a
p=me/neil.parkwaycc.co.uk r=mkaply
This commit is contained in:
Родитель
d7bf16c846
Коммит
e4dd792f02
|
@ -59,6 +59,11 @@
|
||||||
|
|
||||||
<!-- ///////////////// public listbox members ///////////////// -->
|
<!-- ///////////////// public listbox members ///////////////// -->
|
||||||
|
|
||||||
|
<property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
|
||||||
|
else this.removeAttribute('disabled');
|
||||||
|
return val;"
|
||||||
|
onget="return this.hasAttribute('disabled');"/>
|
||||||
|
|
||||||
<property name="listBoxObject"
|
<property name="listBoxObject"
|
||||||
onget="return this.boxObject.QueryInterface(Components.interfaces.nsIListBoxObject);"
|
onget="return this.boxObject.QueryInterface(Components.interfaces.nsIListBoxObject);"
|
||||||
readonly="true"/>
|
readonly="true"/>
|
||||||
|
@ -804,6 +809,7 @@
|
||||||
click, so that drags work correctly. -->
|
click, so that drags work correctly. -->
|
||||||
<handler event="mousedown">
|
<handler event="mousedown">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
if (this.parentNode.disabled) return;
|
||||||
if (!event.ctrlKey && !event.shiftKey && !event.metaKey) {
|
if (!event.ctrlKey && !event.shiftKey && !event.metaKey) {
|
||||||
if (!this.selected) {
|
if (!this.selected) {
|
||||||
parentNode.selectItem(this);
|
parentNode.selectItem(this);
|
||||||
|
@ -815,9 +821,9 @@
|
||||||
|
|
||||||
<!-- On a click (up+down on the same item), deselect everything
|
<!-- On a click (up+down on the same item), deselect everything
|
||||||
except this item. -->
|
except this item. -->
|
||||||
<handler event="click">
|
<handler event="click" button="0">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if (event.button != 0) return;
|
if (this.parentNode.disabled) return;
|
||||||
if (parentNode.selType != "multiple") {
|
if (parentNode.selType != "multiple") {
|
||||||
parentNode.selectItem(this);
|
parentNode.selectItem(this);
|
||||||
}
|
}
|
||||||
|
@ -893,7 +899,12 @@
|
||||||
</implementation>
|
</implementation>
|
||||||
|
|
||||||
<handlers>
|
<handlers>
|
||||||
<handler event="mousedown" button="0" action="if (!this.disabled) this.checked = !this.checked;"/>
|
<handler event="mousedown" button="0">
|
||||||
|
<![CDATA[
|
||||||
|
if (!this.disabled && !this.parentNode.disabled)
|
||||||
|
this.checked = !this.checked;
|
||||||
|
]]>
|
||||||
|
</handler>
|
||||||
</handlers>
|
</handlers>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,10 @@ listbox {
|
||||||
color: -moz-FieldText;
|
color: -moz-FieldText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listbox[disabled="true"] {
|
||||||
|
color: GrayText;
|
||||||
|
}
|
||||||
|
|
||||||
/* ::::: listitem ::::: */
|
/* ::::: listitem ::::: */
|
||||||
|
|
||||||
listitem {
|
listitem {
|
||||||
|
|
|
@ -56,6 +56,10 @@ listbox {
|
||||||
color: -moz-FieldText;
|
color: -moz-FieldText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listbox[disabled="true"] {
|
||||||
|
color: GrayText;
|
||||||
|
}
|
||||||
|
|
||||||
/* ::::: listitem ::::: */
|
/* ::::: listitem ::::: */
|
||||||
|
|
||||||
listitem {
|
listitem {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче