Applied mouse_scroll_pages option to the mouse wheel.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-03-22 22:10:20 +03:00
parent a0dc031854
commit b95c9d42a5
2 changed files with 19 additions and 29 deletions

View File

@ -3288,7 +3288,7 @@ do_panel_event (Gpm_Event * event, WPanel * panel, gboolean * redir)
{
if (is_active)
{
if (panel->top_file > 0)
if (panels_options.mouse_move_pages && (panel->top_file > 0))
prev_page (panel);
else /* We are in first page */
move_up (panel);
@ -3300,7 +3300,8 @@ do_panel_event (Gpm_Event * event, WPanel * panel, gboolean * redir)
{
if (is_active)
{
if (panel->top_file + ITEMS (panel) < panel->count)
if (panels_options.mouse_move_pages
&& (panel->top_file + ITEMS (panel) < panel->count))
next_page (panel);
else /* We are in last page */
move_down (panel);
@ -3316,32 +3317,20 @@ do_panel_event (Gpm_Event * event, WPanel * panel, gboolean * redir)
if (!is_active)
change_panel ();
if (event->y <= 0)
{
mark_if_marking (panel, event);
if (panels_options.mouse_move_pages)
prev_page (panel);
else
move_up (panel);
return MOU_REPEAT;
}
if (event->y > lines)
return MOU_NORMAL;
if (!((panel->top_file + event->y <= panel->count) && event->y <= lines))
{
mark_if_marking (panel, event);
if (panels_options.mouse_move_pages)
next_page (panel);
else
move_down (panel);
return MOU_REPEAT;
}
my_index = panel->top_file + event->y - 1;
if (panel->split && (event->x > ((panel->widget.cols - 2) / 2)))
my_index += llines (panel);
if (my_index >= panel->count)
if (panel->top_file + event->y > panel->count)
my_index = panel->count - 1;
else
{
my_index = panel->top_file + event->y - 1;
if (panel->split && (event->x > ((panel->widget.cols - 2) / 2)))
my_index += llines (panel);
if (my_index >= panel->count)
my_index = panel->count - 1;
}
if (my_index != panel->selected)
{

View File

@ -62,11 +62,12 @@ typedef struct
gboolean navigate_with_arrows; /* If TRUE: l&r arrows are used to chdir if the input line is empty */
gboolean kilobyte_si; /* If TRUE, SI units (1000 based) will be used for larger units
* (kilobyte, megabyte, ...). If FALSE, binary units (1024 based) will be used */
gboolean scroll_pages; /* If TRUE, up/down keys scroll the pane listing by pages */
gboolean mouse_move_pages; /* Move page/item? When clicking on the top or bottom of a panel */
gboolean scroll_pages; /* If TRUE, panel is scrolled by half the display when the cursor reaches
the end or the beginning of the panel */
gboolean mouse_move_pages; /* Scroll page/item using mouse wheel */
gboolean reverse_files_only; /* If TRUE, only selection of files is inverted */
gboolean auto_save_setup;
gboolean filetype_mode; /* If TRUE - then add per file type hilighting */
gboolean filetype_mode; /* If TRUE then add per file type hilighting */
gboolean permission_mode; /* If TRUE, we use permission hilighting */
qsearch_mode_t qsearch_mode; /* Quick search mode */
} panels_options_t;