search-view: reset states when performs the search
Also, reset search when starting a new search from window.
This commit is contained in:
committed by
Erick Pérez Castellanos
parent
469999cd96
commit
8933b1485a
@@ -792,6 +792,9 @@ gcal_search_view_search (GcalSearchView *view,
|
||||
priv->query = g_strdup (query);
|
||||
priv->field = g_strdup (field);
|
||||
|
||||
gtk_widget_show (priv->scrolled_window);
|
||||
gtk_widget_hide (priv->no_results_grid);
|
||||
|
||||
/* Only perform search on valid non-empty strings */
|
||||
if (query && g_utf8_strlen (query, -1) > 0)
|
||||
{
|
||||
|
||||
+1
-4
@@ -529,10 +529,6 @@ search_view_closed (GtkPopover *popover,
|
||||
|
||||
priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
|
||||
|
||||
/* XXX: this is the destruction process */
|
||||
if (!gtk_widget_get_visible (priv->views_stack))
|
||||
return;
|
||||
|
||||
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (priv->header_bar), priv->views_switcher);
|
||||
}
|
||||
|
||||
@@ -1044,6 +1040,7 @@ search_toggled (GObject *object,
|
||||
|
||||
/* update header_bar widget */
|
||||
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (priv->header_bar), NULL);
|
||||
gcal_search_view_search (GCAL_SEARCH_VIEW (priv->views[GCAL_WINDOW_VIEW_SEARCH]), NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user