1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 20:24:13 +01:00

Faster visual bell.

This commit is contained in:
Kris Maglione
2010-11-18 15:53:34 -05:00
parent e8aac67312
commit b01dde9b24
2 changed files with 14 additions and 18 deletions

View File

@@ -139,19 +139,21 @@ const Dactyl = Module("dactyl", {
*/
beep: function () {
if (options["visualbell"]) {
// flash the visual bell
let panel = document.getElementById("dactyl-deck-bell");
if (panel) {
let restore = panel.parentNode.selectedPanel;
if (restore !== panel) {
panel.parentNode.selectedPanel = panel;
util.timeout(function () { panel.parentNode.selectedPanel = restore; }, 20);
}
}
else {
highlight.highlightNode(document.documentElement, "Bell");
util.timeout(function () { document.documentElement.removeAttributeNS(NS, "highlight"); }, 5);
let bell = document.getElementById("dactyl-bell");
let strut = document.getElementById("dactyl-bell-strut");
if (!bell) {
bell = document.documentElement.insertBefore(
util.xmlToDom(<hbox xmlns={XUL} style="display: none" id="dactyl-bell" highlight="Bell"/>, document),
document.documentElement.firstChild);
strut = document.documentElement.appendChild(
util.xmlToDom(<hbox xmlns={XUL} style="display: none" id="dactyl-bell-strut"/>, document));
}
bell.style.height = window.innerHeight + "px";
strut.style.marginBottom = -window.innerHeight + "px";
strut.style.display = bell.style.display = "";
util.timeout(function () { strut.style.display = bell.style.display = "none"; }, 20);
}
else {
let soundService = Cc["@mozilla.org/sound;1"].getService(Ci.nsISound);

View File

@@ -52,12 +52,6 @@
oncommandupdate="&events;.onSelectionChange(event);"/>
</window>
<!--
<deck id="tab-view-deck">
<vbox id="dactyl-deck-bell" dactyl:highlight="Bell"/>
</deck>
-->
<vbox id="&dactyl.commandContainer;">
<vbox class="dactyl-container" hidden="false" collapsed="true">