Changeset 302

Show
Ignore:
Timestamp:
01/25/08 08:41:42 (7 months ago)
Author:
jordi
Message:

Is now possible to zooming by pressin control and scrolling with the scroll version. Thanks to Michael Opitz <opitz.michael@gmail.com> and Lester Godwin <lgodwin@pushcorp.com>.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/THANKS

    r300 r302  
    1111    - Lester Godwin <lgodwin@pushcorp.com>, for his patches. 
    1212    - LoneFox <>, for his patches. 
     13    - Michael Opitz <opitz.michael@gmail.com>, for his patches. 
    1314    - Moritz Heiber <moe@xfce.org>, for his German translation. 
    1415    - Mr_Moustache <mr.moustache@laposte.net>, for his French translation. 
  • trunk/src/gtk/MainView.cxx

    r294 r302  
    7878static void main_window_zoom_width_cb (GtkToggleAction *, gpointer); 
    7979static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer); 
     80static void main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data); 
    8081 
    8182#if defined (HAVE_CUPS) 
     
    268269    m_StatusBar = gtk_statusbar_new (); 
    269270    gtk_box_pack_start (GTK_BOX (m_MainBox), m_StatusBar, FALSE, FALSE, 0); 
     271 
     272    // Signal for Zooming into the page per ctrl + scroll-wheel. 
     273    g_signal_connect (G_OBJECT (m_PageView->getTopWidget ()), "scroll-event", 
     274                      G_CALLBACK (main_window_page_scrolled_cb), pter); 
    270275} 
    271276 
     
    14741479    pter->setPageMode (mode); 
    14751480} 
     1481 
     1482void  
     1483main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data) 
     1484{ 
     1485    g_assert ( NULL != data && "The data parameter is NULL."); 
     1486 
     1487    MainPter *pter = (MainPter *)data; 
     1488    // Only zoom when the CTRL-Button is down... 
     1489    if ( !(event->state & GDK_CONTROL_MASK) ) return; 
     1490    if ( event->direction == GDK_SCROLL_UP ) { 
     1491        pter->zoomInActivated (); 
     1492    } else if ( event->direction == GDK_SCROLL_DOWN ) { 
     1493        pter->zoomOutActivated (); 
     1494    } 
     1495} 
     1496 
  • trunk/src/gtk/PageView.cxx

    r301 r302  
    528528    g_assert ( NULL != data && "The data parameter is NULL."); 
    529529 
     530    // don't scroll when the CRTL-Button is down, because then the page should 
     531    // actually be zoomed and not scrolled. Zooming is handelt by the MainView 
     532    // class. 
     533    if ( event->state & GDK_CONTROL_MASK ) 
     534    { 
     535        return FALSE; 
     536    } 
    530537    PagePter *pter = (PagePter *)data; 
    531538    GtkAdjustment *adjustment =