cc-language-chooser: Reset dialog to original state when used the 2nd time
The language chooser dialog is used in the users panel repeatedly. When we click to show more languages and/or select language, close the dialog and show it again e.g. for different user, the chooser isn't in an original state. So filter entry isn't hidden (and all languages are shown) and/or the last selected language is focused. But the dialog should be in the original state when it is open. This patch changes cc_language_chooser_clear_filter to clear the dialog into the original state that we can reuse the dialog later. https://bugzilla.gnome.org/show_bug.cgi?id=738077
This commit is contained in:
parent
d3c93d9249
commit
066d66383e
1 changed files with 7 additions and 7 deletions
|
@ -285,7 +285,7 @@ filter_changed (GtkDialog *chooser)
|
|||
}
|
||||
|
||||
static void
|
||||
show_more (GtkDialog *chooser)
|
||||
show_more (GtkDialog *chooser, gboolean visible)
|
||||
{
|
||||
CcLanguageChooserPrivate *priv = GET_PRIVATE (chooser);
|
||||
GtkWidget *widget;
|
||||
|
@ -298,16 +298,15 @@ show_more (GtkDialog *chooser)
|
|||
widget = priv->scrolledwindow;
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
visible ? GTK_POLICY_AUTOMATIC : GTK_POLICY_NEVER);
|
||||
|
||||
gtk_widget_show (priv->filter_entry);
|
||||
gtk_widget_grab_focus (priv->filter_entry);
|
||||
gtk_widget_set_visible (priv->filter_entry, visible);
|
||||
gtk_widget_grab_focus (visible ? priv->filter_entry : priv->language_list);
|
||||
|
||||
priv->showing_extra = TRUE;
|
||||
priv->showing_extra = visible;
|
||||
|
||||
gtk_list_box_invalidate_filter (GTK_LIST_BOX (priv->language_list));
|
||||
}
|
||||
|
||||
static void
|
||||
set_locale_id (GtkDialog *chooser,
|
||||
const gchar *locale_id)
|
||||
|
@ -356,7 +355,7 @@ row_activated (GtkListBox *box,
|
|||
return;
|
||||
|
||||
if (row == priv->more_item) {
|
||||
show_more (chooser);
|
||||
show_more (chooser, TRUE);
|
||||
return;
|
||||
}
|
||||
new_locale_id = g_object_get_data (G_OBJECT (row), "locale-id");
|
||||
|
@ -436,6 +435,7 @@ cc_language_chooser_clear_filter (GtkWidget *chooser)
|
|||
CcLanguageChooserPrivate *priv = GET_PRIVATE (chooser);
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->filter_entry), "");
|
||||
show_more (GTK_DIALOG (chooser), FALSE);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
|
|
Loading…
Add table
Reference in a new issue