diff options
author | rbuj <[email protected]> | 2020-06-29 19:04:08 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-07-08 18:19:10 +0200 |
commit | 1f08913e3dea33b4cbc738d38190c232fe808a91 (patch) | |
tree | c1ac7b7e8eea07cf8caf4f41a0fb49d7cc2b8080 | |
parent | 5a8b0d7a26fbbb4e7a29c7476ff5af98e028fdac (diff) | |
download | mate-power-manager-1f08913e3dea33b4cbc738d38190c232fe808a91.tar.bz2 mate-power-manager-1f08913e3dea33b4cbc738d38190c232fe808a91.tar.xz |
Remove unused variable from gpm_notebook_scroll_event_cb
-rw-r--r-- | src/gpm-common.c | 55 | ||||
-rw-r--r-- | src/gpm-common.h | 5 | ||||
-rw-r--r-- | src/gpm-prefs-core.c | 9 | ||||
-rw-r--r-- | src/gpm-statistics.c | 7 |
4 files changed, 37 insertions, 39 deletions
diff --git a/src/gpm-common.c b/src/gpm-common.c index fedc594..5a9d964 100644 --- a/src/gpm-common.c +++ b/src/gpm-common.c @@ -157,11 +157,9 @@ gpm_help_display (const gchar *link_id) g_free (uri); } -/** - * gpm_dialog_page_scroll_event_cb: - **/ gboolean -gpm_dialog_page_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, GtkWindow *window) +gpm_notebook_scroll_event_cb (GtkWidget *widget, + GdkEventScroll *event) { GtkNotebook *notebook = GTK_NOTEBOOK (widget); GtkWidget *child, *event_widget, *action_widget; @@ -180,37 +178,38 @@ gpm_dialog_page_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, GtkWi 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))) 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))) 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); + 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 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); + 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/src/gpm-common.h b/src/gpm-common.h index 8aeedbc..b2b0b1a 100644 --- a/src/gpm-common.h +++ b/src/gpm-common.h @@ -161,9 +161,8 @@ guint gpm_discrete_from_percent (guint percentage, guint gpm_discrete_to_percent (guint discrete, guint levels); void gpm_help_display (const gchar *link_id); -gboolean gpm_dialog_page_scroll_event_cb (GtkWidget *widget, - GdkEventScroll *event, - GtkWindow *window); +gboolean gpm_notebook_scroll_event_cb (GtkWidget *widget, + GdkEventScroll *event); #ifdef EGG_TEST void gpm_common_test (gpointer data); #endif diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c index 93177b6..b43dd12 100644 --- a/src/gpm-prefs-core.c +++ b/src/gpm-prefs-core.c @@ -492,7 +492,6 @@ static void prefs_setup_ups (GpmPrefs *prefs) { GtkWidget *notebook; - GtkWidget *window; gint page; const GpmActionPolicy ups_low_actions[] = @@ -524,12 +523,12 @@ prefs_setup_ups (GpmPrefs *prefs) GPM_SETTINGS_SLEEP_DISPLAY_UPS, display_times); - window = gpm_window (prefs); notebook = GET_WIDGET ("notebook_preferences"); gtk_widget_add_events (notebook, GDK_SCROLL_MASK); - g_signal_connect (GTK_NOTEBOOK (notebook), "scroll-event", - G_CALLBACK (gpm_dialog_page_scroll_event_cb), - window); + g_signal_connect (GTK_NOTEBOOK (notebook), + "scroll-event", + G_CALLBACK (gpm_notebook_scroll_event_cb), + NULL); if (prefs->priv->has_ups == FALSE) { page = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), GET_WIDGET ("box_ups")); diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index bba4081..70b99f6 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -1304,9 +1304,10 @@ main (int argc, char *argv[]) widget = GTK_WIDGET (gtk_builder_get_object (builder, "notebook1")); gtk_widget_add_events (widget, GDK_SCROLL_MASK); - g_signal_connect (widget, "scroll-event", - G_CALLBACK (gpm_dialog_page_scroll_event_cb), - window); + g_signal_connect (widget, + "scroll-event", + G_CALLBACK (gpm_notebook_scroll_event_cb), + NULL); page = g_settings_get_int (settings, GPM_SETTINGS_INFO_PAGE_NUMBER); gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), page); |