~ubuntu-branches/ubuntu/hardy/eog/hardy-updates

« back to all changes in this revision

Viewing changes to src/eog-scroll-view.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-11-23 00:07:04 UTC
  • mfrom: (1.1.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20071123000704-txc8vcqe2gntmv42
Tags: 2.21.1-0ubuntu1
* New upstream version:
  New features:
  - Contextual menu in image view widget
  Misc improvements/fixes:
  - Several code cleanups and improvements
  Bug fixes:
  - #482752, crash when opening a tiff image (eog_image_load)
  - #475124, Add " (invalid Unicode)" suffix when image caption is 
             not a valid utf8 string
  - #475645, When an image is saved, the selection is lost
  - #476313, plugins about dialog is not gtk+-2.11/2.12 ready
  - #476919, eog save menu is always active
  - #477550, fileformat combobox in save-as-many dialog is empty
  - #479029, eog crashes when showing Image Collection
  - #479400, Renamed files vanish from the collection
  - #479884, Mouse dragging UI broken.
  - #481096, Thumbnails in collection viewer not updated when scrolling 
  - #481301, Add a context menu in main window (open with/properties etc.) 
  - #482128, Hangs on XPM file (Felix Riemann)
  - #486057, "SetAsWallpaper" functionality doesn't 
       launch background properties
  - #488344, using the scroll buttons of a non-first instance of eog scrolls 
             the collection on the first one
  - #488808, eog won't display some .jpg files
  - #490065, Retry string not marked for translation
  - #481712, Substandard .desktop file (patch against latest SVN attached)
* Sync with Debian
* debian/control.in:
  - Build-Depends on liblaunchpad-integration-dev, python-central (>= 0.5.6)
  - don't use libexempi for now which is to universe
  - list required change for the python use
  - set XS-Vcs-Bzr tag
  - updated maintainer informations
  - use require Replaces for files which moved to the new binary
* debian/patches/01_lpi.patch:
  - launchpad integration
* debian/patches/02_autoconf.patch:
  - configure update
* debian/patches/03_hide_menu_item.patch:
  - menu simplication (MenuRevisited spec)
* debian/rules:
  - call dh_pycentral
  - update clean target
  - use --enable-python option

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        GtkAdjustment *vadj;
73
73
        GtkWidget *hbar;
74
74
        GtkWidget *vbar;
 
75
        GtkWidget *menu;
75
76
 
76
77
        /* actual image */
77
78
        EogImage *image;
1217
1218
        switch (event->button) {
1218
1219
                case 1:
1219
1220
                case 2:
1220
 
                        if (event->button == 1 && !(event->state & GDK_CONTROL_MASK))
 
1221
                        if (event->button == 1 && !priv->scroll_wheel_zoom && 
 
1222
                            !(event->state & GDK_CONTROL_MASK))
1221
1223
                                break;
1222
1224
 
1223
1225
                        if (is_image_movable (view)) {
1920
1922
        priv->transp_style = EOG_TRANSP_BACKGROUND;
1921
1923
        priv->transp_color = 0;
1922
1924
        priv->cursor = EOG_SCROLL_VIEW_CURSOR_NORMAL;
 
1925
        priv->menu = NULL;
1923
1926
}
1924
1927
 
1925
1928
static void
2065
2068
        return widget;
2066
2069
}
2067
2070
 
 
2071
static void 
 
2072
eog_scroll_view_popup_menu (EogScrollView *view, GdkEventButton *event)
 
2073
{
 
2074
        GtkWidget *popup;
 
2075
        int button, event_time;
 
2076
 
 
2077
        popup = view->priv->menu;
 
2078
        
 
2079
        if (event) {
 
2080
                button = event->button;
 
2081
                event_time = event->time;
 
2082
        } else {
 
2083
                button = 0;
 
2084
                event_time = gtk_get_current_event_time ();
 
2085
        }
 
2086
        
 
2087
        gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL, 
 
2088
                        button, event_time);
 
2089
}
 
2090
 
 
2091
static gboolean
 
2092
view_on_button_press_event_cb (GtkWidget *view, GdkEventButton *event, 
 
2093
                               gpointer user_data)
 
2094
{    
 
2095
    /* Ignore double-clicks and triple-clicks */
 
2096
    if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
 
2097
    {
 
2098
            eog_scroll_view_popup_menu (EOG_SCROLL_VIEW (view), event);
 
2099
 
 
2100
            return TRUE;
 
2101
    }
 
2102
    
 
2103
    return FALSE;
 
2104
}
 
2105
 
 
2106
void
 
2107
eog_scroll_view_set_popup (EogScrollView *view,
 
2108
                           GtkMenu *menu)
 
2109
{
 
2110
        g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
 
2111
        g_return_if_fail (view->priv->menu == NULL);
 
2112
 
 
2113
        view->priv->menu = g_object_ref (menu);
 
2114
 
 
2115
        gtk_menu_attach_to_widget (GTK_MENU (view->priv->menu), 
 
2116
                                   GTK_WIDGET (view), 
 
2117
                                   NULL);
 
2118
 
 
2119
        g_signal_connect (G_OBJECT (view), "button_press_event",
 
2120
                          G_CALLBACK (view_on_button_press_event_cb), NULL);
 
2121
}
 
2122
 
2068
2123
void
2069
2124
eog_scroll_view_set_scroll_wheel_zoom (EogScrollView *view, 
2070
2125
                                       gboolean       scroll_wheel_zoom)