mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 499298 - menubar auto-hiding doesn't work when removing default items from the toolbar. r=neil
This commit is contained in:
parent
c0f741760c
commit
7eb8b0e356
@ -308,6 +308,21 @@
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="hasCustomInteractiveItems">
|
||||
<parameter name="aCurrentSet"/>
|
||||
<body><![CDATA[
|
||||
if (aCurrentSet == "__empty")
|
||||
return false;
|
||||
|
||||
var defaultOrNoninteractive = (this.getAttribute("defaultset") || "")
|
||||
.split(",")
|
||||
.concat(["separator", "spacer", "spring"]);
|
||||
return aCurrentSet.split(",").some(function (item) {
|
||||
return defaultOrNoninteractive.indexOf(item) == -1;
|
||||
});
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
@ -366,26 +381,10 @@
|
||||
<method name="currentSetChanged">
|
||||
<parameter name="aCurrentSet"/>
|
||||
<body><![CDATA[
|
||||
var defaultSet = this.getAttribute("defaultset");
|
||||
if (!defaultSet || aCurrentSet == defaultSet) {
|
||||
this.removeAttribute("customized");
|
||||
return;
|
||||
}
|
||||
|
||||
function normalize(aSet) {
|
||||
return aSet.split(",").filter(function (element) {
|
||||
return element != "separator" &&
|
||||
element != "spacer" &&
|
||||
element != "spring" &&
|
||||
element != "__empty";
|
||||
}).sort().join(",");
|
||||
}
|
||||
if (normalize(aCurrentSet) == normalize(defaultSet)) {
|
||||
this.removeAttribute("customized");
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.hasCustomInteractiveItems(aCurrentSet))
|
||||
this.setAttribute("customized", "true");
|
||||
else
|
||||
this.removeAttribute("customized");
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user