[gtksourceview] Select the default scheme if the previous one was removed
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Select the default scheme if the previous one was removed
- Date: Tue, 30 Dec 2014 22:33:53 +0000 (UTC)
commit 68284a69047f02dbd7005f16639aaf1e049b4d65
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Dec 30 23:33:12 2014 +0100
Select the default scheme if the previous one was removed
gtksourceview/gtksourcestyleschemechooserwidget.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcestyleschemechooserwidget.c
b/gtksourceview/gtksourcestyleschemechooserwidget.c
index 60c773c..af35a5c 100644
--- a/gtksourceview/gtksourcestyleschemechooserwidget.c
+++ b/gtksourceview/gtksourcestyleschemechooserwidget.c
@@ -196,6 +196,7 @@ gtk_source_style_scheme_chooser_widget_populate (GtkSourceStyleSchemeChooserWidg
GtkSourceStyleSchemeManager *manager;
const gchar * const *scheme_ids;
guint i;
+ gboolean row_selected = FALSE;
gtk_container_foreach (GTK_CONTAINER (priv->list_box),
(GtkCallback)gtk_widget_destroy,
@@ -221,8 +222,17 @@ gtk_source_style_scheme_chooser_widget_populate (GtkSourceStyleSchemeChooserWidg
g_signal_handlers_block_by_func (priv->list_box, on_row_selected, widget);
gtk_list_box_select_row (priv->list_box, GTK_LIST_BOX_ROW (row));
g_signal_handlers_unblock_by_func (priv->list_box, on_row_selected, widget);
+
+ row_selected = TRUE;
}
}
+
+ /* The current scheme may have been removed so select the default one */
+ if (!row_selected)
+ {
+ gtk_source_style_scheme_chooser_set_style_scheme (GTK_SOURCE_STYLE_SCHEME_CHOOSER (widget),
+ _gtk_source_style_scheme_get_default ());
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]