summaryrefslogtreecommitdiff
path: root/gtk/gtkappchooserwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkappchooserwidget.c')
-rw-r--r--gtk/gtkappchooserwidget.c24
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);
+}