From 91a9af4e2f57e52573579168180d5694dbb76ab2 Mon Sep 17 00:00:00 2001 From: tamplan Date: Sat, 23 May 2020 11:20:51 +0200 Subject: Add tab scrolling support for GTK3 mate-window-properties and mate-appearance-properties --- capplets/appearance/appearance-main.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'capplets/appearance') diff --git a/capplets/appearance/appearance-main.c b/capplets/appearance/appearance-main.c index 3d401d4b..031040d8 100644 --- a/capplets/appearance/appearance-main.c +++ b/capplets/appearance/appearance-main.c @@ -138,6 +138,8 @@ main (int argc, char **argv) { AppearanceData *data; GtkWidget *w; + GtkWidget *nb; + GtkWidget *nb_custom_theme; GtkStyleContext *context; gchar *install_filename = NULL; @@ -204,9 +206,9 @@ main (int argc, char **argv) if (wallpaper_files && !install_filename && !start_page) start_page = g_strdup ("background"); - GtkNotebook* nb = GTK_NOTEBOOK(appearance_capplet_get_widget (data, "main_notebook")); - gtk_widget_add_events (GTK_WIDGET (nb), GDK_SCROLL_MASK); - g_signal_connect (GTK_WIDGET (nb), "scroll-event", + nb = appearance_capplet_get_widget (data, "main_notebook"); + gtk_widget_add_events (nb, GDK_SCROLL_MASK); + g_signal_connect (nb, "scroll-event", G_CALLBACK (capplet_dialog_page_scroll_event_cb), GTK_WINDOW (w)); @@ -219,10 +221,12 @@ main (int argc, char **argv) w = appearance_capplet_get_widget (data, page_name); if (w != NULL) { gint pindex; + GtkNotebook *notebook; - pindex = gtk_notebook_page_num (nb, w); + notebook = GTK_NOTEBOOK (nb); + pindex = gtk_notebook_page_num (notebook, w); if (pindex != -1) - gtk_notebook_set_current_page (nb, pindex); + gtk_notebook_set_current_page (notebook, pindex); } g_free (page_name); } @@ -236,6 +240,12 @@ main (int argc, char **argv) g_option_context_free (option_context); + nb_custom_theme = appearance_capplet_get_widget (data, "notebook2"); + gtk_widget_add_events (nb_custom_theme, GDK_SCROLL_MASK); + g_signal_connect (nb_custom_theme, "scroll-event", + G_CALLBACK (capplet_dialog_page_scroll_event_cb), + GTK_WINDOW (w)); + /* start the mainloop */ gtk_main (); -- cgit v1.2.1