Bug 817820 - Change cursor to reflect that middle-click scrolling (autoscroll) is active. r=mbrubeck

This commit is contained in:
Marina Samuel msamuel@mozilla.com 2013-06-11 17:46:36 -04:00
parent f8777270e3
commit a6a03481c6
8 changed files with 74 additions and 0 deletions

View File

@ -51,6 +51,8 @@
this.removeEventListener("pageshow", this.onPageShow, true);
this.removeEventListener("pagehide", this.onPageHide, true);
this.removeEventListener("DOMPopupBlocked", this.onPopupBlocked, true);
this.setAttribute("autoscrollpopup", "autoscrollerid");
]]>
</constructor>

View File

@ -0,0 +1,37 @@
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="element-popup">
<implementation implements="nsIPopupBoxObject">
<method name="showPopup">
<parameter name="srcConent"/>
<parameter name="xpos"/>
<parameter name="ypos"/>
<parameter name="popupType"/>
<parameter name="anchorAlignment"/>
<parameter name="popupAlignment"/>
<body>
<![CDATA[
this.style.visibility = 'visible';
this.style.left = xpos + "px";
this.style.top = ypos + "px";
]]>
</body>
</method>
<method name="hidePopup">
<body>
<![CDATA[
this.style.visibility = 'hidden';
let event = document.createEvent("Events");
event.initEvent("popuphidden", true, false);
let dispatcher = this;
dispatcher.dispatchEvent(event);
]]>
</body>
</method>
</implementation>
</binding>
</bindings>

View File

@ -42,6 +42,10 @@ setting {
display: none;
}
autoscroller {
-moz-binding: url('chrome://browser/content/bindings/popup.xml#element-popup');
}
setting[type="bool"] {
display: -moz-box;
-moz-binding: url("chrome://browser/content/bindings/toggleswitch.xml#setting-fulltoggle-bool");

View File

@ -369,6 +369,8 @@
<!-- onclick addresses dom bug 835175, str in bug 832957 -->
<box onclick="false" class="selection-overlay-hidden" id="selection-overlay"/>
<autoscroller class="autoscroller" id="autoscrollerid"/>
<html:div id="overlay-back" class="overlay-button"
observes="cmd_back" onclick="CommandUpdater.doCommand('cmd_back');"></html:div>
<html:div id="overlay-plus" class="overlay-button"

View File

@ -27,6 +27,7 @@ chrome.jar:
content/bindings/flyoutpanel.xml (content/bindings/flyoutpanel.xml)
content/bindings/selectionoverlay.xml (content/bindings/selectionoverlay.xml)
content/bindings/cssthrobber.xml (content/bindings/cssthrobber.xml)
content/bindings/popup.xml (content/bindings/popup.xml)
content/prompt/alert.xul (content/prompt/alert.xul)
content/prompt/confirm.xul (content/prompt/confirm.xul)

View File

@ -1013,3 +1013,30 @@ setting[type="radio"] > vbox {
margin-left: -18px;
pointer-events: auto;
}
/* :::::: autoscroll popup ::::: */
.autoscroller {
height: 28px;
width: 28px;
border: none;
margin: -14px;
padding: 0;
background-image: url("chrome://browser/skin/images/autoscroll.png");
background-color: transparent;
position: fixed;
visibility: hidden;
background-repeat: no-repeat;
background-origin: padding-box;
background-clip: padding-box;
background-position: right top;
-moz-appearance: none;
}
.autoscroller[scrolldir="NS"] {
background-position: right center;
}
.autoscroller[scrolldir="EW"] {
background-position: right bottom;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -82,3 +82,4 @@ chrome.jar:
skin/images/overlay-back.png (images/overlay-back.png)
skin/images/overlay-plus.png (images/overlay-plus.png)
skin/images/autoscroll.png (images/autoscroll.png)