From d587e0fbfe7f983b39dfbbf21e4ca05aa1354583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 21 Aug 2009 19:36:07 +0000 Subject: [PATCH] * Not sure why we are that generous (copying BView behaviour), but pressing Alt, Option, or Control while scrolling the menu via the mouse wheel now scrolls page wise. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32581 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 008ebe3b89..c7c46761a0 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -842,11 +842,20 @@ BMenu::MessageReceived(BMessage* msg) if (window == NULL) return; + float largeStep; float smallStep; - window->GetSteps(&smallStep, NULL); - window->TryScrollBy(deltaY * smallStep); + window->GetSteps(&smallStep, &largeStep); + + // pressing the option/command/control key scrolls faster + if (modifiers() & (B_OPTION_KEY | B_COMMAND_KEY | B_CONTROL_KEY)) + deltaY *= largeStep; + else + deltaY *= smallStep; + + window->TryScrollBy(deltaY); break; } + default: BView::MessageReceived(msg); break;