Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2011-01-28 Aparna Nandyal <aparna.nand@wipro.com>
        Reviewed by Andreas Kling.

        Setting value of m_PressedPos to make scrolling smooth

        Page scroll popup menu "Scroll here" option not working when cliking above scroll slider/handler.
        https://bugs.webkit.org/show_bug.cgi?id=51349

        The value of m_PressedPos was getting set before moveThumb() call
        in all other scenarios except when "Scroll Here" option is used.
        Hence scrolling with this option was not as expected even in cases
        where scrolling was happening. The thumb would move in unexpected
        direction. m_PressedPos is now set to pressed position so delta is
        calculated.
        Unable to write a test case as the test needs to click on "Scroll
        Here" option of context sensitive menu and QTest is unable to do it.
        Besides no new functionality introduced.

        * platform/qt/ScrollbarQt.cpp:
        (WebCore::Scrollbar::contextMenu):

Canonical link: https://commits.webkit.org/67118@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Jan 28, 2011
1 parent 1460432 commit e532c2b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,25 @@
2011-01-28 Aparna Nandyal <aparna.nand@wipro.com>

Reviewed by Andreas Kling.

Setting value of m_PressedPos to make scrolling smooth

Page scroll popup menu "Scroll here" option not working when cliking above scroll slider/handler.
https://bugs.webkit.org/show_bug.cgi?id=51349

The value of m_PressedPos was getting set before moveThumb() call
in all other scenarios except when "Scroll Here" option is used.
Hence scrolling with this option was not as expected even in cases
where scrolling was happening. The thumb would move in unexpected
direction. m_PressedPos is now set to pressed position so delta is
calculated.
Unable to write a test case as the test needs to click on "Scroll
Here" option of context sensitive menu and QTest is unable to do it.
Besides no new functionality introduced.

* platform/qt/ScrollbarQt.cpp:
(WebCore::Scrollbar::contextMenu):

2011-01-28 Andrey Kosyakov <caseq@chromium.org>

Reviewed by Pavel Feldman.
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/platform/qt/ScrollbarQt.cpp
Expand Up @@ -74,6 +74,11 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event)
QAction* actionSelected = menu.exec(globalPos);

if (actionSelected == actScrollHere) {
// Set the pressed position to the middle of the thumb so that when we
// do move, the delta will be from the current pixel position of the
// thumb to the new position
int position = theme()->trackPosition(this) + theme()->thumbPosition(this) + theme()->thumbLength(this) / 2;
setPressedPos(position);
const QPoint pos = convertFromContainingWindow(event.pos());
moveThumb(horizontal ? pos.x() : pos.y());
} else if (actionSelected == actScrollTop)
Expand Down

0 comments on commit e532c2b

Please sign in to comment.