[prev in list] [next in list] [prev in thread] [next in thread]
List: lyx-cvs
Subject: r34731 - lyx-devel/trunk/src/frontends/qt4
From: lasgouttes () lyx ! org
Date: 2010-06-30 12:38:40
Message-ID: 20100630123840.04B3530873 () lyx ! lyx ! org
[Download RAW message or body]
Author: lasgouttes
Date: Wed Jun 30 14:38:39 2010
New Revision: 34731
URL: http://www.lyx.org/trac/changeset/34731
Log:
fix scroll wheel on mac (bug #6775)
Modified:
lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp
Modified: lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp Wed Jun 30 13:04:30 2010 (r34730)
+++ lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.cpp Wed Jun 30 14:38:39 2010 (r34731)
@@ -816,9 +816,9 @@
{
// Wheel rotation by one notch results in a delta() of 120 (see
// documentation of QWheelEvent)
- int const delta = ev->delta() / 120;
+ double const delta = ev->delta() / 120.0;
if (ev->modifiers() & Qt::ControlModifier) {
- docstring arg = convert<docstring>(5 * delta);
+ docstring arg = convert<docstring>(int(5 * delta));
lyx::dispatch(FuncRequest(LFUN_BUFFER_ZOOM_IN, arg));
return;
}
@@ -830,11 +830,8 @@
int scroll_value = lines > page_step
? page_step : lines * verticalScrollBar()->singleStep();
- // Take into account the rotation.
- scroll_value *= delta;
-
- // Take into account user preference.
- scroll_value = int(scroll_value * lyxrc.mouse_wheel_speed);
+ // Take into account the rotation and the user preferences.
+ scroll_value = int(scroll_value * delta * lyxrc.mouse_wheel_speed);
LYXERR(Debug::SCROLLING, "wheelScrollLines = " << lines
<< " delta = " << delta << " scroll_value = " << scroll_value
<< " page_step = " << page_step);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic