Panel_Mousewheel_Scroll.patch



Trivial Patch #10262:
This patch scrolls one line at at time instead of one page at a time
when spinning the mousewheel.

Does anyone like it or find it useful?



--- mc-cvs-4.6.0-pre1b-021217/src/screen.c	Sun Dec 15 22:42:17 2002
+++ mc-draft-4.6.0-pre1b-021217/src/screen.c	Tue Dec 17 12:31:22 2002
@@ -2261,11 +2261,22 @@ panel_event (Gpm_Event *event, WPanel *p
 
     /* Mouse wheel events */
     if ((event->buttons & GPM_B_UP) && (event->type & GPM_DOWN)) {
-	prev_page (panel);
+	if ( panel_scroll_pages ) {
+		panel->top_file -= 1;
+		if (panel->top_file < 0) panel->top_file = 0;
+		paint_dir (panel);
+        }
 	return MOU_NORMAL;
     }
     if ((event->buttons & GPM_B_DOWN) && (event->type & GPM_DOWN)) {
-	next_page (panel);
+	if ( panel->count > ITEMS (panel) && panel_scroll_pages ){
+		panel->top_file += 1;
+		if (panel->top_file > panel->count - ITEMS (panel))
+			panel->top_file = panel->count - ITEMS (panel);
+		paint_dir (panel);
+        }
 	return MOU_NORMAL;
     }
 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]