After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 109996 - zoom widget with wheel support - "patch" included
zoom widget with wheel support - "patch" included
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
0.x.x [obsolete]
Other other
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-04-04 19:30 UTC by danny.milo
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.1/2.2



Description danny.milo 2003-04-04 19:30:12 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 ;)
Comment 1 Alexander Larsson 2003-05-06 08:18:30 UTC
In cvs.