diff options
author | tamplan <[email protected]> | 2020-05-23 11:20:51 +0200 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2020-05-26 22:03:15 +0200 |
commit | 91a9af4e2f57e52573579168180d5694dbb76ab2 (patch) | |
tree | 21a52aa84a08523fb358ce25942b857209a752ed /capplets | |
parent | 6b0fd11cf82b68ad177883deef722e078d851fc4 (diff) | |
download | mate-control-center-91a9af4e2f57e52573579168180d5694dbb76ab2.tar.bz2 mate-control-center-91a9af4e2f57e52573579168180d5694dbb76ab2.tar.xz |
Add tab scrolling support for GTK3
mate-window-properties and mate-appearance-properties
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/appearance/appearance-main.c | 20 | ||||
-rw-r--r-- | capplets/windows/mate-window-properties.c | 8 |
2 files changed, 23 insertions, 5 deletions
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 (); diff --git a/capplets/windows/mate-window-properties.c b/capplets/windows/mate-window-properties.c index a4513089..90e0b785 100644 --- a/capplets/windows/mate-window-properties.c +++ b/capplets/windows/mate-window-properties.c @@ -298,6 +298,7 @@ main (int argc, char **argv) GError *error = NULL; GtkBuilder *builder; GdkScreen *screen; + GtkWidget *nb; gchar *str; const char *current_wm; int i; @@ -342,6 +343,13 @@ main (int argc, char **argv) /* Window */ dialog_win = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_win")); + /* Notebook */ + nb = GTK_WIDGET (gtk_builder_get_object (builder, "nb")); + gtk_widget_add_events (nb, GDK_SCROLL_MASK); + g_signal_connect (nb, "scroll-event", + G_CALLBACK (capplet_dialog_page_scroll_event_cb), + GTK_WINDOW (dialog_win)); + /* Compositing manager */ compositing_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "compositing_checkbutton")); compositing_fast_alt_tab_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "compositing_fast_alt_tab_checkbutton")); |