summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eel/eel-gtk-extensions.c66
-rw-r--r--eel/eel-gtk-extensions.h5
-rw-r--r--src/caja-file-management-properties.c9
-rw-r--r--src/file-manager/fm-properties-window.c4
4 files changed, 41 insertions, 43 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index f460e24d..aecbcc75 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -508,7 +508,8 @@ eel_image_menu_item_new_from_surface (cairo_surface_t *icon_surface,
}
gboolean
-eel_dialog_page_scroll_event_callback (GtkWidget *widget, GdkEventScroll *event, GtkWindow *window)
+eel_notebook_scroll_event_cb (GtkWidget *widget,
+ GdkEventScroll *event)
{
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GtkWidget *child, *event_widget, *action_widget;
@@ -517,51 +518,48 @@ eel_dialog_page_scroll_event_callback (GtkWidget *widget, GdkEventScroll *event,
if (child == NULL)
return FALSE;
- event_widget = gtk_get_event_widget ((GdkEvent *) event);
+ event_widget = gtk_get_event_widget ((GdkEvent*) event);
/* Ignore scroll events from the content of the page */
- if (event_widget == NULL ||
- event_widget == child ||
- gtk_widget_is_ancestor (event_widget, child))
+ if (event_widget == NULL || event_widget == child || gtk_widget_is_ancestor (event_widget, child))
return FALSE;
/* And also from the action widgets */
action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_START);
- if (event_widget == action_widget ||
- (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
+ if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
return FALSE;
+
action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_END);
- if (event_widget == action_widget ||
- (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
+ if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget)))
return FALSE;
switch (event->direction) {
- case GDK_SCROLL_RIGHT:
- case GDK_SCROLL_DOWN:
- gtk_notebook_next_page (notebook);
- break;
- case GDK_SCROLL_LEFT:
- case GDK_SCROLL_UP:
- gtk_notebook_prev_page (notebook);
- break;
- case GDK_SCROLL_SMOOTH:
- switch (gtk_notebook_get_tab_pos (notebook)) {
- case GTK_POS_LEFT:
- case GTK_POS_RIGHT:
- if (event->delta_y > 0)
- gtk_notebook_next_page (notebook);
- else if (event->delta_y < 0)
- gtk_notebook_prev_page (notebook);
- break;
- case GTK_POS_TOP:
- case GTK_POS_BOTTOM:
- if (event->delta_x > 0)
- gtk_notebook_next_page (notebook);
- else if (event->delta_x < 0)
- gtk_notebook_prev_page (notebook);
- break;
+ case GDK_SCROLL_RIGHT:
+ case GDK_SCROLL_DOWN:
+ gtk_notebook_next_page (notebook);
+ break;
+ case GDK_SCROLL_LEFT:
+ case GDK_SCROLL_UP:
+ gtk_notebook_prev_page (notebook);
+ break;
+ case GDK_SCROLL_SMOOTH:
+ switch (gtk_notebook_get_tab_pos (notebook)) {
+ case GTK_POS_LEFT:
+ case GTK_POS_RIGHT:
+ if (event->delta_y > 0)
+ gtk_notebook_next_page (notebook);
+ else if (event->delta_y < 0)
+ gtk_notebook_prev_page (notebook);
+ break;
+ case GTK_POS_TOP:
+ case GTK_POS_BOTTOM:
+ if (event->delta_x > 0)
+ gtk_notebook_next_page (notebook);
+ else if (event->delta_x < 0)
+ gtk_notebook_prev_page (notebook);
+ break;
}
- break;
+ break;
}
return TRUE;
diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h
index c3be8940..8d9cf790 100644
--- a/eel/eel-gtk-extensions.h
+++ b/eel/eel-gtk-extensions.h
@@ -73,7 +73,6 @@ GtkWidget * eel_image_menu_item_new_from_icon (const gch
GtkWidget * eel_image_menu_item_new_from_surface (cairo_surface_t *icon_surface,
const gchar *label_name);
-gboolean eel_dialog_page_scroll_event_callback (GtkWidget *widget,
- GdkEventScroll *event,
- GtkWindow *window);
+gboolean eel_notebook_scroll_event_cb (GtkWidget *widget,
+ GdkEventScroll *event);
#endif /* EEL_GTK_EXTENSIONS_H */
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index eeeb6a27..d352732a 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -1246,10 +1246,11 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi
}
GtkWidget *notebook = GTK_WIDGET (gtk_builder_get_object (builder, "notebook1"));
- gtk_widget_add_events (GTK_WIDGET (notebook), GDK_SCROLL_MASK);
- g_signal_connect (GTK_WIDGET (notebook), "scroll-event",
- G_CALLBACK (eel_dialog_page_scroll_event_callback),
- window);
+ gtk_widget_add_events (notebook, GDK_SCROLL_MASK);
+ g_signal_connect (notebook,
+ "scroll-event",
+ G_CALLBACK (eel_notebook_scroll_event_cb),
+ NULL);
gtk_widget_show (dialog);
}
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index a583b073..af3058d5 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -5225,8 +5225,8 @@ create_properties_window (StartupData *startup_data)
gtk_widget_add_events (GTK_WIDGET (window->details->notebook), GDK_SCROLL_MASK);
g_signal_connect (window->details->notebook,
"scroll-event",
- G_CALLBACK (eel_dialog_page_scroll_event_callback),
- window);
+ G_CALLBACK (eel_notebook_scroll_event_cb),
+ NULL);
gtk_widget_show (GTK_WIDGET (window->details->notebook));
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),