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

Re: gEDA-user: Question on scrolling behavior



On Mon, 2009-02-23 at 08:39 +0000, smichalske@xxxxxxxxx wrote:
> Folks,
>    Inspired by Peter Clifton's GTK like scrolling patch (
>    5c2712f20b59c92e82151a18999292d00c1502c5 ), I decided to craft my on
>    addition to it.
>    I added left/right scrolling capabilities, so my trackpad would work
>    out well.
>    would the users/developers like an adaptation of this patch applied
>    back to gpleda's pcb/master ?
>    hardkrash

NB: This is on my local customisations branch (to suit my own
preferences about the scroll-wheel binding):

commit 5c2712f20b59c92e82151a18999292d00c1502c5
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Feb 22 03:02:55 2009 +0000

    Change scroll-wheel bindings to match more GTK applications

diff --git a/src/hid/gtk/gui-output-events.c
b/src/hid/gtk/gui-output-events.c
index 0deb12e..f7b4b2f 100644
--- a/src/hid/gtk/gui-output-events.c
+++ b/src/hid/gtk/gui-output-events.c
@@ -1336,18 +1336,18 @@ ghid_port_window_mouse_scroll_cb (GtkWidget *
widget,
 
   state = (GdkModifierType) (ev->state);
   mk = ghid_modifier_keys_state (&state);
+
   if (mk == NONE_PRESSED)
+    dy = ghid_port.height * gport->zoom / 40;
+  else if (mk == SHIFT_PRESSED)
+    dx = ghid_port.width * gport->zoom / 40;
+  else if (mk == CONTROL_PRESSED)
     {
       zoom_factor = (ev->direction == GDK_SCROLL_UP) ? 0.8 : 1.25;
       ghid_port_ranges_zoom (gport->zoom * zoom_factor);
       return TRUE;
     }
 
-  if (mk == SHIFT_PRESSED)
-    dy = ghid_port.height * gport->zoom / 40;
-  else
-    dx = ghid_port.width * gport->zoom / 40;
-
   if (ev->direction == GDK_SCROLL_UP)
     {
       dx = -dx;



I'd be interested to see the changes, and certainly to extend my own
quick fix.

As for git HEAD, we'd need to come up with some way of making the
behaviour configurable (perhaps mapping all bindings through some config
file, similarly to how we define menu / key bindings). As much as I'd
love my favourite default in git HEAD, I don't think it would be
accepted.

(Even if the LF work is intended to make PCB behave more like other GTK
apps).

FWIW, gschem has this configurable as "GTK" or "classic", with "classic"
still being the default.

The GTK style scroll-wheel bindings make a lot more sense when you have
something like a touchpad with multi-touch, multi-axis scroll gestures,
or X and Y axis scrolling regions. Certainly they make sense when many
other (albiet not all) apps on your desktop use the GTK style.

I wish I'd realised that before I promoted the scroll == zoom default in
gschem!


-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user