mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 08:35:46 +01:00
Faster visual bell.
This commit is contained in:
@@ -139,19 +139,21 @@ const Dactyl = Module("dactyl", {
|
|||||||
*/
|
*/
|
||||||
beep: function () {
|
beep: function () {
|
||||||
if (options["visualbell"]) {
|
if (options["visualbell"]) {
|
||||||
// flash the visual bell
|
let bell = document.getElementById("dactyl-bell");
|
||||||
let panel = document.getElementById("dactyl-deck-bell");
|
let strut = document.getElementById("dactyl-bell-strut");
|
||||||
if (panel) {
|
if (!bell) {
|
||||||
let restore = panel.parentNode.selectedPanel;
|
bell = document.documentElement.insertBefore(
|
||||||
if (restore !== panel) {
|
util.xmlToDom(<hbox xmlns={XUL} style="display: none" id="dactyl-bell" highlight="Bell"/>, document),
|
||||||
panel.parentNode.selectedPanel = panel;
|
document.documentElement.firstChild);
|
||||||
util.timeout(function () { panel.parentNode.selectedPanel = restore; }, 20);
|
strut = document.documentElement.appendChild(
|
||||||
}
|
util.xmlToDom(<hbox xmlns={XUL} style="display: none" id="dactyl-bell-strut"/>, document));
|
||||||
}
|
|
||||||
else {
|
|
||||||
highlight.highlightNode(document.documentElement, "Bell");
|
|
||||||
util.timeout(function () { document.documentElement.removeAttributeNS(NS, "highlight"); }, 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
else {
|
||||||
let soundService = Cc["@mozilla.org/sound;1"].getService(Ci.nsISound);
|
let soundService = Cc["@mozilla.org/sound;1"].getService(Ci.nsISound);
|
||||||
|
|||||||
@@ -52,12 +52,6 @@
|
|||||||
oncommandupdate="&events;.onSelectionChange(event);"/>
|
oncommandupdate="&events;.onSelectionChange(event);"/>
|
||||||
</window>
|
</window>
|
||||||
|
|
||||||
<!--
|
|
||||||
<deck id="tab-view-deck">
|
|
||||||
<vbox id="dactyl-deck-bell" dactyl:highlight="Bell"/>
|
|
||||||
</deck>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vbox id="&dactyl.commandContainer;">
|
<vbox id="&dactyl.commandContainer;">
|
||||||
|
|
||||||
<vbox class="dactyl-container" hidden="false" collapsed="true">
|
<vbox class="dactyl-container" hidden="false" collapsed="true">
|
||||||
|
|||||||
Reference in New Issue
Block a user