From 36b7ad0cd2e5d99670a1d96fa3c163700991e8df Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 10 Oct 2016 16:53:32 +0200 Subject: [PATCH] shortcutswindow: Modernize some code No functional changes, just don't call valist functions anymore. --- gtk/gtkshortcutswindow.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c index 4f40231267..8cb22c6edd 100644 --- a/gtk/gtkshortcutswindow.c +++ b/gtk/gtkshortcutswindow.c @@ -862,13 +862,14 @@ static void gtk_shortcuts_window_init (GtkShortcutsWindow *self) { GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self); - GtkToggleButton *search_button; + GtkWidget *search_button; GtkBox *menu_box; GtkBox *box; GtkWidget *arrow; GtkWidget *scroller; GtkWidget *label; GtkWidget *empty; + GtkWidget *search_icon; PangoAttrList *attributes; gtk_window_set_resizable (GTK_WINDOW (self), FALSE); @@ -889,15 +890,14 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self) NULL); gtk_window_set_titlebar (GTK_WINDOW (self), GTK_WIDGET (priv->header_bar)); - search_button = g_object_new (GTK_TYPE_TOGGLE_BUTTON, - "child", g_object_new (GTK_TYPE_IMAGE, - "visible", TRUE, - "icon-name", "edit-find-symbolic", - NULL), - "visible", TRUE, - NULL); - gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (search_button)), "image-button"); - gtk_container_add (GTK_CONTAINER (priv->header_bar), GTK_WIDGET (search_button)); + search_icon = gtk_image_new_from_icon_name ("edit-find-symbolic", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (search_icon); + + search_button = gtk_toggle_button_new (); + gtk_container_add (GTK_CONTAINER (search_button), search_icon); + gtk_style_context_add_class (gtk_widget_get_style_context (search_button), "image-button"); + gtk_widget_show (search_button); + gtk_container_add (GTK_CONTAINER (priv->header_bar), search_button); priv->main_box = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_VERTICAL,