зеркало из https://github.com/mozilla/pjs.git
Camino only - Bug 426739: Add (undocumented) trackpad swipe support. r/sr=pink
This commit is contained in:
Родитель
8f41294fad
Коммит
7fce915cec
|
@ -684,6 +684,23 @@ public:
|
|||
mMoveReentrant = NO;
|
||||
}
|
||||
|
||||
// Undocumented method for handling multi-touch swipe events in 10.5.
|
||||
// The worst that's likely to happen is that this would just stop being
|
||||
// called if the gesture system changes in a future version.
|
||||
- (void)swipeWithEvent:(NSEvent*)event
|
||||
{
|
||||
// Map forward and back to history; left is positive, right is negative (!)
|
||||
if ([event deltaX] > 0.5)
|
||||
[self back:nil];
|
||||
else if ([event deltaX] < -0.5)
|
||||
[self forward:nil];
|
||||
// Map up and down to page up/down
|
||||
else if ([event deltaY] > 0.5)
|
||||
[[mBrowserView browserView] pageUp];
|
||||
else if ([event deltaY] < -0.5)
|
||||
[[mBrowserView browserView] pageDown];
|
||||
}
|
||||
|
||||
-(void)autosaveWindowFrame
|
||||
{
|
||||
if (mShouldAutosave) {
|
||||
|
|
|
@ -255,6 +255,9 @@ typedef enum {
|
|||
- (BOOL)canMakeTextSmaller;
|
||||
- (BOOL)isTextDefaultSize;
|
||||
|
||||
- (void)pageUp;
|
||||
- (void)pageDown;
|
||||
|
||||
// Verifies that the browser view can be unloaded (e.g., validates
|
||||
// onbeforeunload handlers). Should be called before any action that would
|
||||
// destroy the browser view.
|
||||
|
|
|
@ -1274,6 +1274,16 @@ const char kDirServiceContractID[] = "@mozilla.org/file/directory_service;1";
|
|||
return (fabsf([self textZoom] - DEFAULT_TEXT_ZOOM) < .001);
|
||||
}
|
||||
|
||||
- (void)pageUp
|
||||
{
|
||||
[self doCommand:"cmd_scrollPageUp"];
|
||||
}
|
||||
|
||||
- (void)pageDown
|
||||
{
|
||||
[self doCommand:"cmd_scrollPageDown"];
|
||||
}
|
||||
|
||||
- (BOOL)shouldUnload
|
||||
{
|
||||
nsCOMPtr<nsIContentViewer> contentViewer = dont_AddRef([self contentViewer]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче