Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GTK] clicking on the scrollbar trough steps rather than jumps to the…
… clicked position https://bugs.webkit.org/show_bug.cgi?id=115363 Reviewed by Michael Catanzaro. Allow ScrollbarTheme to decide the behavior of a button press event, instead of only deciding whether to center on thumb or not. This way we can match the current GTK+ behavior in WebKit, without affecting other ports. * platform/ScrollTypes.h: Add ScrollbarButtonPressAction enum. * platform/Scrollbar.cpp: (WebCore::Scrollbar::mouseDown): Ask ScrollbarTheme to handle the event for the pressed part and do the requested action. * platform/ScrollbarTheme.cpp: (WebCore::ScrollbarTheme::handleMousePressEvent): Add default implementation. It's equivalent to the previous default implementation. * platform/ScrollbarTheme.h: * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::handleMousePressEvent): Match current GTK+ behavior: left click centers on thumb and right click scrolls. Dragging the thumb works for left and middle buttons. * platform/gtk/ScrollbarThemeGtk.h: * platform/ios/ScrollbarThemeIOS.h: Remove shouldCenterOnThumb, and don't override handleMousePressEvent since iOS wants the default behavior. * platform/ios/ScrollbarThemeIOS.mm: * platform/mac/ScrollbarThemeMac.h: Override handleMousePressEvent and remove shouldCenterOnThumb. * platform/mac/ScrollbarThemeMac.mm: (WebCore::shouldCenterOnThumb): Same implementation just made it static to be used as helper. (WebCore::ScrollbarThemeMac::handleMousePressEvent): Return the desired action keeping the same behavior. * platform/win/ScrollbarThemeWin.cpp: (WebCore::ScrollbarThemeWin::handleMousePressEvent): Ditto. * platform/win/ScrollbarThemeWin.h: * rendering/RenderScrollbarTheme.h: Canonical link: https://commits.webkit.org/172396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
161c8fb
commit 0bd053218b1c67f7bf017c98adbbafcdea303da2
Showing
14 changed files
with
139 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -180,6 +180,13 @@ enum ScrollBehaviorForFixedElements { | ||
StickToViewportBounds | ||
}; | ||
|
||
enum class ScrollbarButtonPressAction { | ||
None, | ||
CenterOnThumb, | ||
StartDrag, | ||
Scroll | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters