зеркало из https://github.com/mozilla/gecko-dev.git
Adding sample to show how tool icons don't properly update when told to via css.
This commit is contained in:
Родитель
4e56d39a03
Коммит
7fa1736cfd
|
@ -35,6 +35,8 @@ EXPORT_RESOURCE_SAMPLES = \
|
|||
$(srcdir)/dexsimplemaster.xul \
|
||||
$(srcdir)/dexsimpledialog.xul \
|
||||
$(srcdir)/dexopenchrome.xul \
|
||||
$(srcdir)/hidetoolicon.xul \
|
||||
$(srcdir)/hidetoolicon.css \
|
||||
$(srcdir)/tab.xul \
|
||||
$(srcdir)/xpmenu.xul \
|
||||
$(NULL)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
window[buttonmode="hideOne"] input#ButtonOne,
|
||||
window[buttonmode="hideAll"] input#ButtonOne
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
|
||||
window[buttonmode="hideTwo"] input#ButtonTwo,
|
||||
window[buttonmode="hideAll"] input#ButtonTwo
|
||||
{
|
||||
display:none;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="hidetoolicon.css" type="text/css"?>
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
align="vertical">
|
||||
|
||||
<html:script>
|
||||
function cmdHideButtonOne(){
|
||||
window.document.getElementById("ShowButton").setAttribute("buttonmode", "hideOne");
|
||||
}
|
||||
|
||||
function cmdHideButtonTwo() {
|
||||
window.document.getElementById("ShowButton").setAttribute("buttonmode", "hideTwo");
|
||||
}
|
||||
|
||||
function cmdHideAll() {
|
||||
window.document.getElementById("ShowButton").setAttribute("buttonmode", "hideAll");
|
||||
}
|
||||
|
||||
function cmdShowAll() {
|
||||
window.document.getElementById("ShowButton").setAttribute("buttonmode", "showAll");
|
||||
}
|
||||
</html:script>
|
||||
|
||||
<broadcaster id="ShowButton" buttonmode="showAll" />
|
||||
<observes element="ShowButton" attribute="buttonmode" />
|
||||
<toolbox>
|
||||
<toolbar>
|
||||
<html:input type="BUTTON" value="Button 1" id="ButtonOne"/>
|
||||
<html:input type="BUTTON" value="Button 2" id="ButtonTwo"/>
|
||||
<spring flex="1"/>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<box flex="1">
|
||||
<html:input flex="1" type="BUTTON" value="Hide Only Button 1" onclick="cmdHideButtonOne()"/>
|
||||
<html:input flex="1" type="BUTTON" value="Hide Only Button 2" onclick="cmdHideButtonTwo()"/>
|
||||
<html:input flex="1" type="BUTTON" value="Hide Both" onclick="cmdHideAll()"/>
|
||||
<html:input flex="1" type="BUTTON" value="Show Both" onclick="cmdShowAll()"/>
|
||||
</box>
|
||||
</window>
|
|
@ -33,6 +33,8 @@ install:: $(DLL)
|
|||
$(MAKE_INSTALL) dexsimplemaster.xul $(DIST)\bin\res\samples
|
||||
$(MAKE_INSTALL) dexsimpledialog.xul $(DIST)\bin\res\samples
|
||||
$(MAKE_INSTALL) dexopenchrome.xul $(DIST)\bin\res\samples
|
||||
$(MAKE_INSTALL) hidetoolicon.xul $(DIST)\bin\res\samples
|
||||
$(MAKE_INSTALL) hidetoolicon.css $(DIST)\bin\res\samples
|
||||
$(MAKE_INSTALL) tab.xul $(DIST)\bin\res\samples
|
||||
$(MAKE_INSTALL) xpmenu.xul $(DIST)\bin\res\samples
|
||||
|
||||
|
@ -48,5 +50,7 @@ clobber::
|
|||
rm -f $(DIST)\res\samples\dexsimplemaster.xul
|
||||
rm -f $(DIST)\res\samples\dexsimpledialog.xul
|
||||
rm -f $(DIST)\res\samples\dexopenchrome.xul
|
||||
rm -f $(DIST)\res\samples\hidetoolicon.xul
|
||||
rm -f $(DIST)\res\samples\hidetoolicon.css
|
||||
rm -f $(DIST)\res\samples\tab.xul
|
||||
rm -f $(DIST)\res\samples\xpmenu.xul
|
||||
|
|
Загрузка…
Ссылка в новой задаче