Changeset 556

Show
Ignore:
Timestamp:
08/23/08 21:49:19 (3 months ago)
Author:
bjourne
Message:

Handle GDK_SCROLL_LEFT as GDK_SCROLL_UP and GDK_SCROLL_RIGHT as GDK_SCROLL_DOWN. It is better than assert failing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gtkimageview/src/gtkimageview.c

    r540 r556  
    897897    GtkImageView *view = GTK_IMAGE_VIEW (widget); 
    898898 
    899     // Horizontal scroll events will be handled in the future. 
    900     g_assert (ev->direction == GDK_SCROLL_UP || 
    901               ev->direction == GDK_SCROLL_DOWN); 
    902  
    903899    if (!(ev->state & GDK_CONTROL_MASK)) 
    904900    { 
     
    908904        return TRUE; 
    909905    } 
    910      
     906 
     907    // Horizontal scroll left is equivalent to scroll up and right is 
     908    // like scroll down. No idea if that is correct -- I have no input 
     909    // device that can do horizontal scrolls. 
    911910    gdouble zoom = gtk_zooms_get_zoom_out (view->zoom); 
    912     if (ev->direction == GDK_SCROLL_UP
     911    if (ev->direction == GDK_SCROLL_UP || ev->direction == GDK_SCROLL_LEFT
    913912        zoom = gtk_zooms_get_zoom_in (view->zoom); 
    914913    gtk_image_view_set_zoom_with_center (view, zoom, ev->x, ev->y, FALSE); 
     
    11021101     * GtkImageView::mouse-wheel-scroll: 
    11031102     * @view: The #GtkImageView that emitted the signal. 
    1104      * @direction: The direction of the scroll; either %GDK_SCROLL_UP 
    1105      *      or %GDK_SCROLL_DOWN
     1103     * @direction: The direction of the scroll; %GDK_SCROLL_UP, 
     1104     *   %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT or %GDK_SCROLL_RIGHT
    11061105     * 
    11071106     * The ::mouse-wheel-scroll signal is emitted when the mouse wheel