mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Darren's patch, reworked
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5451 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e4707d7f88
commit
ebef7baa26
@ -258,9 +258,9 @@ bool BufferView::dispatch(FuncRequest const & ev)
|
||||
}
|
||||
|
||||
|
||||
int BufferView::scroll(long time)
|
||||
void BufferView::scroll(int lines)
|
||||
{
|
||||
return pimpl_->scroll(time);
|
||||
pimpl_->scroll(lines);
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,8 +165,8 @@ public:
|
||||
void toggleToggle();
|
||||
///
|
||||
void center();
|
||||
///
|
||||
int scroll(long time);
|
||||
/// scroll document by the given number of lines of default height
|
||||
void scroll(int lines);
|
||||
|
||||
/// Scroll the view by a number of pixels
|
||||
void scrollDocView(int);
|
||||
|
@ -384,19 +384,25 @@ void BufferView::Pimpl::scrollDocView(int value)
|
||||
}
|
||||
|
||||
|
||||
int BufferView::Pimpl::scroll(long time)
|
||||
void BufferView::Pimpl::scroll(int lines)
|
||||
{
|
||||
if (!buffer_)
|
||||
return 0;
|
||||
if (!buffer_) {
|
||||
return;
|
||||
}
|
||||
|
||||
LyXText const * t = bv_->text;
|
||||
int const line_height = t->defaultHeight();
|
||||
|
||||
double const diff = t->defaultHeight()
|
||||
+ double(time) * double(time) * 0.125;
|
||||
int const disp = lines * line_height;
|
||||
|
||||
scrollDocView(int(diff));
|
||||
// Restrict to a valid value
|
||||
int new_first_y = std::min(t->height - 4 * line_height, disp);
|
||||
new_first_y = std::max(0, disp);
|
||||
|
||||
scrollDocView(new_first_y);
|
||||
|
||||
// Update the scrollbar.
|
||||
workarea().setScrollbarParams(t->height, t->first_y, t->defaultHeight());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,8 +60,10 @@ struct BufferView::Pimpl : public boost::signals::trackable {
|
||||
void updateScrollbar();
|
||||
///
|
||||
void scrollDocView(int value);
|
||||
/// wheel mouse scroll
|
||||
int scroll(long time);
|
||||
/**
|
||||
* Wheel mouse scroll, move by multiples of text->defaultHeight().
|
||||
*/
|
||||
void scroll(int lines);
|
||||
///
|
||||
void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
|
||||
///
|
||||
|
@ -1,3 +1,11 @@
|
||||
2002-10-21 John Levon <levon@movementarian.org>
|
||||
|
||||
* BufferView.h:
|
||||
* BufferView.C:
|
||||
* BufferView_pimpl.h:
|
||||
* BufferView_pimpl.C: fix mouse wheel handling based on
|
||||
patch from Darren Freeman
|
||||
|
||||
2002-10-09 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* lyx_main.C (queryUserLyXDir): Fix automatic reconfiguration.
|
||||
|
Loading…
Reference in New Issue
Block a user