[gnome-software/gnome-3-14] Fix the build with gtk+ 3.14
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-14] Fix the build with gtk+ 3.14
- Date: Thu, 18 Jun 2015 20:53:37 +0000 (UTC)
commit 9eb4249bf0f528201ea71cd9f5dd6d5ecf99bf37
Author: Kalev Lember <klember redhat com>
Date: Thu Jun 18 22:45:34 2015 +0200
Fix the build with gtk+ 3.14
Don't use gtk_text_view_set_monospace() that's only available starting
with gtk+ 3.16. Instead, construct a monospace pango font description
manually and set it on the textview widget.
src/gs-offline-updates.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-offline-updates.c b/src/gs-offline-updates.c
index 3e132f4..f98043f 100644
--- a/src/gs-offline-updates.c
+++ b/src/gs-offline-updates.c
@@ -245,6 +245,7 @@ insert_details_widget (GtkMessageDialog *dialog, const gchar *details)
GtkTextBuffer *buffer;
GList *children;
GString *msg;
+ PangoFontDescription *font_desc;
if (!details)
return;
@@ -293,11 +294,15 @@ insert_details_widget (GtkMessageDialog *dialog, const gchar *details)
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv));
gtk_text_view_set_editable (GTK_TEXT_VIEW (tv), FALSE);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (tv), GTK_WRAP_WORD);
- gtk_text_view_set_monospace (GTK_TEXT_VIEW (tv), TRUE);
gtk_text_buffer_set_text (buffer, msg->str, -1);
tmp_apply_tags (buffer);
gtk_widget_set_visible (tv, TRUE);
+ /* Make the textview monospaced */
+ font_desc = pango_font_description_from_string ("monospace");
+ gtk_widget_override_font (tv, font_desc);
+ pango_font_description_free (font_desc);
+
gtk_container_add (GTK_CONTAINER (sw), tv);
gtk_box_pack_end (GTK_BOX (message_area), sw, TRUE, TRUE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]