Commit 9bf42bf5 authored by Guido Gunther's avatar Guido Gunther Committed by Guido Gunther
Browse files

overview: Add helper to focus app search


Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent a4f64e10
......@@ -423,3 +423,14 @@ phosh_app_grid_reset (PhoshAppGrid *self)
gtk_entry_set_text (GTK_ENTRY (priv->search), "");
g_clear_pointer (&priv->search_string, g_free);
}
void
phosh_app_grid_focus_search (PhoshAppGrid *self)
{
PhoshAppGridPrivate *priv;
g_return_if_fail (PHOSH_IS_APP_GRID (self));
priv = phosh_app_grid_get_instance_private (self);
gtk_widget_grab_focus (priv->search);
}
......@@ -23,5 +23,6 @@ struct _PhoshAppGridClass
GtkWidget *phosh_app_grid_new (void);
void phosh_app_grid_reset (PhoshAppGrid *self);
void phosh_app_grid_focus_search (PhoshAppGrid *self);
G_END_DECLS
......@@ -453,3 +453,13 @@ phosh_overview_reset (PhoshOverview *self)
if (priv->activity)
gtk_widget_grab_focus (GTK_WIDGET (priv->activity));
}
void
phosh_overview_focus_app_search (PhoshOverview *self)
{
PhoshOverviewPrivate *priv;
g_return_if_fail(PHOSH_IS_OVERVIEW (self));
priv = phosh_overview_get_instance_private (self);
phosh_app_grid_focus_search (PHOSH_APP_GRID (priv->app_grid));
}
......@@ -15,3 +15,4 @@ G_DECLARE_FINAL_TYPE (PhoshOverview, phosh_overview, PHOSH, OVERVIEW, GtkBox)
GtkWidget *phosh_overview_new (void);
void phosh_overview_reset (PhoshOverview *self);
void phosh_overview_focus_app_search (PhoshOverview *self);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment