git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@25407 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-07-01 07:15:20 +00:00
parent 4070ca5e5c
commit f84d8c405f
2 changed files with 23 additions and 3 deletions

View File

@ -48,6 +48,8 @@
#include <boost/bind.hpp>
#include <boost/current_function.hpp>
#include <cmath>
#ifdef Q_WS_X11
#include <QX11Info>
extern "C" int XEventsQueued(Display *display, int mode);
@ -420,9 +422,24 @@ void GuiWorkArea::wheelEvent(QWheelEvent * e)
{
// Wheel rotation by one notch results in a delta() of 120 (see
// documentation of QWheelEvent)
int const lines = qApp->wheelScrollLines() * e->delta() / 120;
verticalScrollBar()->setValue(verticalScrollBar()->value() -
lines * verticalScrollBar()->singleStep());
int const delta = e->delta() / 120;
int const lines = qApp->wheelScrollLines();
int scroll_value;
// Test if the wheel mouse is set to one screen at a time.
int const page_step = verticalScrollBar()->pageStep();
if (lines > page_step)
scroll_value = page_step * delta;
else
scroll_value = lines * verticalScrollBar()->singleStep() * delta;
LYXERR(Debug::GUI) << "Wheel Scroll "
<< " page_step = " << page_step
<< " line step = " << verticalScrollBar()->singleStep()
<< " delta = " << delta
<< " lines = " << lines
<< " scroll_value = " << scroll_value << endl;
// Now scroll.
verticalScrollBar()->setValue(verticalScrollBar()->value() - scroll_value);
adjustViewWithScrollBar();
}

View File

@ -97,6 +97,9 @@ What's new
- Use appropriate font in notes and ERT insets in section headings
(bug 2477).
- Fix wheel mouse scrolling when it is set to "One screen at a time
(bug 4972).
- Fix shape of braces, '$', '%', '&', and '#', which where incorrectly
shown in italics in mathed (bug 4320).