mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 06:49:56 +00:00
fix scroll wheel on mac (bug #6775)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34731 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
af928c503d
commit
50117dc8ea
@ -816,9 +816,9 @@ void GuiWorkArea::wheelEvent(QWheelEvent * ev)
|
|||||||
{
|
{
|
||||||
// Wheel rotation by one notch results in a delta() of 120 (see
|
// Wheel rotation by one notch results in a delta() of 120 (see
|
||||||
// documentation of QWheelEvent)
|
// documentation of QWheelEvent)
|
||||||
int const delta = ev->delta() / 120;
|
double const delta = ev->delta() / 120.0;
|
||||||
if (ev->modifiers() & Qt::ControlModifier) {
|
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));
|
lyx::dispatch(FuncRequest(LFUN_BUFFER_ZOOM_IN, arg));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -830,11 +830,8 @@ void GuiWorkArea::wheelEvent(QWheelEvent * ev)
|
|||||||
int scroll_value = lines > page_step
|
int scroll_value = lines > page_step
|
||||||
? page_step : lines * verticalScrollBar()->singleStep();
|
? page_step : lines * verticalScrollBar()->singleStep();
|
||||||
|
|
||||||
// Take into account the rotation.
|
// Take into account the rotation and the user preferences.
|
||||||
scroll_value *= delta;
|
scroll_value = int(scroll_value * delta * lyxrc.mouse_wheel_speed);
|
||||||
|
|
||||||
// Take into account user preference.
|
|
||||||
scroll_value = int(scroll_value * lyxrc.mouse_wheel_speed);
|
|
||||||
LYXERR(Debug::SCROLLING, "wheelScrollLines = " << lines
|
LYXERR(Debug::SCROLLING, "wheelScrollLines = " << lines
|
||||||
<< " delta = " << delta << " scroll_value = " << scroll_value
|
<< " delta = " << delta << " scroll_value = " << scroll_value
|
||||||
<< " page_step = " << page_step);
|
<< " page_step = " << page_step);
|
||||||
|
Loading…
Reference in New Issue
Block a user