Use gtk_search_bar_set_child throughout

This commit is contained in:
Matthias Clasen 2020-05-03 09:58:27 -04:00
parent e2abe6dd29
commit 99ef14b59f
3 changed files with 4 additions and 3 deletions

View File

@ -87,7 +87,7 @@ do_search_entry2 (GtkWidget *do_widget)
searchbar = gtk_search_bar_new ();
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_EDITABLE (entry));
gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE);
gtk_container_add (GTK_CONTAINER (searchbar), container);
gtk_search_bar_set_child (GTK_SEARCH_BAR (searchbar), container);
gtk_container_add (GTK_CONTAINER (vbox), searchbar);
/* Hook the search bar to key presses */

View File

@ -19,7 +19,7 @@ activate_cb (GtkApplication *app,
gtk_widget_show (search_bar);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (search_bar), box);
gtk_search_bar_set_child (GTK_SEARCH_BAR (search_bar), box);
entry = gtk_search_entry_new ();
gtk_widget_set_hexpand (entry, TRUE);

View File

@ -910,7 +910,8 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
gtk_popover_set_child (GTK_POPOVER (priv->popover), GTK_WIDGET (priv->list_box));
priv->search_entry = GTK_SEARCH_ENTRY (gtk_search_entry_new ());
gtk_container_add (GTK_CONTAINER (priv->search_bar), GTK_WIDGET (priv->search_entry));
gtk_search_bar_set_child (GTK_SEARCH_BAR (priv->search_bar), GTK_WIDGET (priv->search_entry));
g_object_set (priv->search_entry,
/* Translators: This is placeholder text for the search entry in the shortcuts window */
"placeholder-text", _("Search Shortcuts"),