[gtksourceview] Use GtkTextView:monospace property
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Use GtkTextView:monospace property
- Date: Sun, 2 Nov 2014 16:16:50 +0000 (UTC)
commit adaf0808e732c74f6e3a94d0d85f9d2f958b55ab
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Nov 2 17:12:55 2014 +0100
Use GtkTextView:monospace property
gtk_widget_override_font() is deprecated.
tests/test-completion.c | 8 --------
tests/test-completion.ui | 3 +--
tests/test-search.c | 6 ------
tests/test-search.ui | 1 +
tests/test-widget.c | 9 ---------
tests/test-widget.ui | 1 +
6 files changed, 3 insertions(+), 25 deletions(-)
---
diff --git a/tests/test-completion.c b/tests/test-completion.c
index fa6c97e..0a6b0bd 100644
--- a/tests/test-completion.c
+++ b/tests/test-completion.c
@@ -349,7 +349,6 @@ create_window (void)
GtkCheckButton *enable_random_provider;
GtkSpinButton *nb_fixed_proposals;
GtkSpinButton *nb_random_proposals;
- PangoFontDescription *font_desc;
builder = gtk_builder_new ();
@@ -376,13 +375,6 @@ create_window (void)
completion = gtk_source_view_get_completion (source_view);
- font_desc = pango_font_description_from_string ("monospace");
- if (font_desc != NULL)
- {
- gtk_widget_override_font (GTK_WIDGET (source_view), font_desc);
- pango_font_description_free (font_desc);
- }
-
g_signal_connect (window,
"destroy",
G_CALLBACK (gtk_main_quit),
diff --git a/tests/test-completion.ui b/tests/test-completion.ui
index 5158af0..4137507 100644
--- a/tests/test-completion.ui
+++ b/tests/test-completion.ui
@@ -347,9 +347,8 @@
<property name="vexpand">True</property>
<property name="left_margin">2</property>
<property name="right_margin">2</property>
- <property name="tab_width">4</property>
<property name="auto_indent">True</property>
- <property name="indent_on_tab">False</property>
+ <property name="monospace">True</property>
<child internal-child="completion">
<object class="GtkSourceCompletion">
<property name="remember_info_visibility">True</property>
diff --git a/tests/test-search.c b/tests/test-search.c
index c3914ff..c7062df 100644
--- a/tests/test-search.c
+++ b/tests/test-search.c
@@ -415,16 +415,10 @@ test_search_class_init (TestSearchClass *klass)
static void
test_search_init (TestSearch *search)
{
- PangoFontDescription *font;
-
search->priv = test_search_get_instance_private (search);
gtk_widget_init_template (GTK_WIDGET (search));
- font = pango_font_description_from_string ("Monospace 10");
- gtk_widget_override_font (GTK_WIDGET (search->priv->source_view), font);
- pango_font_description_free (font);
-
search->priv->source_buffer = GTK_SOURCE_BUFFER (
gtk_text_view_get_buffer (GTK_TEXT_VIEW (search->priv->source_view)));
diff --git a/tests/test-search.ui b/tests/test-search.ui
index 5e8ae80..b822e96 100644
--- a/tests/test-search.ui
+++ b/tests/test-search.ui
@@ -45,6 +45,7 @@
<property name="vexpand">True</property>
<property name="left_margin">2</property>
<property name="right_margin">2</property>
+ <property name="monospace">True</property>
</object>
</child>
</object>
diff --git a/tests/test-widget.c b/tests/test-widget.c
index a293701..ed0eae5 100644
--- a/tests/test-widget.c
+++ b/tests/test-widget.c
@@ -964,8 +964,6 @@ test_widget_class_init (TestWidgetClass *klass)
static void
test_widget_init (TestWidget *self)
{
- PangoFontDescription *font_desc;
-
self->priv = test_widget_get_instance_private (self);
gtk_widget_init_template (GTK_WIDGET (self));
@@ -1007,13 +1005,6 @@ test_widget_init (TestWidget *self)
G_CALLBACK (line_mark_activated_cb),
self);
- font_desc = pango_font_description_from_string ("monospace");
- if (font_desc != NULL)
- {
- gtk_widget_override_font (GTK_WIDGET (self->priv->view), font_desc);
- pango_font_description_free (font_desc);
- }
-
open_file (self, TOP_SRCDIR "/gtksourceview/gtksourcebuffer.c");
}
diff --git a/tests/test-widget.ui b/tests/test-widget.ui
index a29658f..ade9e8e 100644
--- a/tests/test-widget.ui
+++ b/tests/test-widget.ui
@@ -549,6 +549,7 @@
<property name="vexpand">True</property>
<property name="left_margin">2</property>
<property name="right_margin">2</property>
+ <property name="monospace">True</property>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]