Bug 969250 - Part 1: Implement scroll snapping for scrollbars (v5 Patch). r=roc
This commit is contained in:
@@ -141,19 +141,19 @@ nsScrollbarButtonFrame::HandleButtonPress(nsPresContext* aPresContext,
|
||||
case 0:
|
||||
sb->SetIncrementToLine(direction);
|
||||
if (m) {
|
||||
m->ScrollByLine(sb, direction);
|
||||
m->ScrollByLine(sb, direction, nsIScrollbarMediator::ENABLE_SNAP);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sb->SetIncrementToPage(direction);
|
||||
if (m) {
|
||||
m->ScrollByPage(sb, direction);
|
||||
m->ScrollByPage(sb, direction, nsIScrollbarMediator::ENABLE_SNAP);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
sb->SetIncrementToWhole(direction);
|
||||
if (m) {
|
||||
m->ScrollByWhole(sb, direction);
|
||||
m->ScrollByWhole(sb, direction, nsIScrollbarMediator::ENABLE_SNAP);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -187,6 +187,15 @@ nsScrollbarButtonFrame::HandleRelease(nsPresContext* aPresContext,
|
||||
// we're not active anymore
|
||||
mContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::active, true);
|
||||
StopRepeat();
|
||||
nsIFrame* scrollbar;
|
||||
GetParentWithTag(nsGkAtoms::scrollbar, this, scrollbar);
|
||||
nsScrollbarFrame* sb = do_QueryFrame(scrollbar);
|
||||
if (sb) {
|
||||
nsIScrollbarMediator* m = sb->GetScrollbarMediator();
|
||||
if (m) {
|
||||
m->ScrollbarReleased(sb);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user