diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-02-14 07:02:32 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-02-14 07:05:13 -0500 |
commit | f217af54ca7694e497b50a876062de7ed4633825 (patch) | |
tree | 3b9f9f374a5e08813c3a891bb16003bc69b3caed /gtk/gtkappchooserwidget.c | |
parent | e30f5dd00dea61f0e55d92701bac8d4dea6c88c2 (diff) | |
download | gtk+-f217af54ca7694e497b50a876062de7ed4633825.tar.gz |
app chooser: Add a search bar
This replaces the treeview typeahead popup with a GtkSearchBar,
and adds a search button to the header bar (if we have one).
https://bugzilla.gnome.org/show_bug.cgi?id=724218
Diffstat (limited to 'gtk/gtkappchooserwidget.c')
-rw-r--r-- | gtk/gtkappchooserwidget.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/gtk/gtkappchooserwidget.c b/gtk/gtkappchooserwidget.c index 652f934960..9c14b021f9 100644 --- a/gtk/gtkappchooserwidget.c +++ b/gtk/gtkappchooserwidget.c @@ -659,7 +659,7 @@ gtk_app_chooser_add_default (GtkAppChooserWidget *self, } static void -add_no_applications_label (GtkAppChooserWidget *self) +update_no_applications_label (GtkAppChooserWidget *self) { gchar *text = NULL, *desc = NULL; const gchar *string; @@ -789,14 +789,9 @@ gtk_app_chooser_widget_real_add_items (GtkAppChooserWidget *self) } if (!apps_added) - { - add_no_applications_label (self); - gtk_widget_show (self->priv->no_apps); - } - else - { - gtk_widget_hide (self->priv->no_apps); - } + update_no_applications_label (self); + + gtk_widget_set_visible (self->priv->no_apps, !apps_added); gtk_app_chooser_widget_select_first (self); @@ -1486,3 +1481,14 @@ gtk_app_chooser_widget_get_default_text (GtkAppChooserWidget *self) return self->priv->default_text; } + +void +_gtk_app_chooser_widget_set_search_entry (GtkAppChooserWidget *self, + GtkEntry *entry) +{ + gtk_tree_view_set_search_entry (GTK_TREE_VIEW (self->priv->program_list), entry); + + g_object_bind_property (self->priv->no_apps, "visible", + entry, "sensitive", + G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN); +} |