Commit 3138aa97 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eb1566ee
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> 2011-01-28 Andrey Kosyakov <caseq@chromium.org>
   
Reviewed by Pavel Feldman. Reviewed by Pavel Feldman.
...@@ -74,6 +74,11 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event) ...@@ -74,6 +74,11 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event)
QAction* actionSelected = menu.exec(globalPos); QAction* actionSelected = menu.exec(globalPos);
if (actionSelected == actScrollHere) { 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()); const QPoint pos = convertFromContainingWindow(event.pos());
moveThumb(horizontal ? pos.x() : pos.y()); moveThumb(horizontal ? pos.x() : pos.y());
} else if (actionSelected == actScrollTop) } else if (actionSelected == actScrollTop)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment