GNOME Bugzilla – Bug 109996
zoom widget with wheel support - "patch" included
Last modified: 2004-12-22 21:47:04 UTC
To be able to point onto the little zoom widget in nautilus and then use the wheel to change the zoom level add: widget_class->scroll_event = nautilus_zoom_control_scroll_event; into function nautilus_zoom_control_class_init (file nautilus-zoom-control.c in src/). And this is the new function: static gboolean nautilus_zoom_control_scroll_event (GtkWidget *widget, GdkEventScroll *event) { NautilusZoomControl *zoom_control; int width, center; zoom_control = NAUTILUS_ZOOM_CONTROL (widget); if (event->type != GDK_SCROLL) { return FALSE; } //gtk_widget_grab_focus (widget); // just NO. if ((event->direction == GDK_SCROLL_DOWN) && nautilus_zoom_control_can_zoom_out (zoom_control)) { g_signal_emit (widget, signals[ZOOM_OUT], 0); } else if ((event->direction == GDK_SCROLL_UP) && nautilus_zoom_control_can_zoom_in (zoom_control)) { g_signal_emit (widget, signals[ZOOM_IN], 0); } /* We don't change our state (to reflect the new zoom) here. The zoomable will * call back with the new level. Actually, the callback goes to the view-frame * containing the zoomable which, in turn, emits zoom_level_changed, which * someone (e.g. nautilus_window) picks up and handles by calling into us - * nautilus_zoom_control_set_zoom_level. */ return TRUE; } I've patched my copy of nautilus (cvs) with this and using it for a week, stable till now ;)
In cvs.