Bug 969250 - Part 1: Implement scroll snapping for scrollbars (v5 Patch). r=roc
This commit is contained in:
@@ -264,7 +264,8 @@ nsSliderFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
nsIScrollbarMediator* mediator = scrollbarFrame->GetScrollbarMediator();
|
||||
scrollbarFrame->SetIncrementToWhole(direction);
|
||||
if (mediator) {
|
||||
mediator->ScrollByWhole(scrollbarFrame, direction);
|
||||
mediator->ScrollByWhole(scrollbarFrame, direction,
|
||||
nsIScrollbarMediator::ENABLE_SNAP);
|
||||
}
|
||||
}
|
||||
// 'this' might be destroyed here
|
||||
@@ -1153,6 +1154,14 @@ nsSliderFrame::HandleRelease(nsPresContext* aPresContext,
|
||||
{
|
||||
StopRepeat();
|
||||
|
||||
nsIFrame* scrollbar = GetScrollbar();
|
||||
nsScrollbarFrame* sb = do_QueryFrame(scrollbar);
|
||||
if (sb) {
|
||||
nsIScrollbarMediator* m = sb->GetScrollbarMediator();
|
||||
if (m) {
|
||||
m->ScrollbarReleased(sb);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -1261,7 +1270,7 @@ nsSliderFrame::PageScroll(nscoord aChange)
|
||||
nsIScrollbarMediator* m = sb->GetScrollbarMediator();
|
||||
sb->SetIncrementToPage(aChange);
|
||||
if (m) {
|
||||
m->ScrollByPage(sb, aChange);
|
||||
m->ScrollByPage(sb, aChange, nsIScrollbarMediator::ENABLE_SNAP);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user