|
|
e76f14 |
From 5239a0d260109d33d1e436bc63fee4b6e58c44c8 Mon Sep 17 00:00:00 2001
|
|
|
e76f14 |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
e76f14 |
Date: Sat, 18 Jun 2016 15:31:34 +0100
|
|
|
e76f14 |
Subject: [PATCH] p2v: Use a monospace font for the run dialog.
|
|
|
e76f14 |
|
|
|
e76f14 |
(cherry picked from commit ca6fea7616f89775180ab686133052eca18f0e00)
|
|
|
e76f14 |
---
|
|
|
e76f14 |
p2v/gui.c | 14 ++++++++++++++
|
|
|
e76f14 |
1 file changed, 14 insertions(+)
|
|
|
e76f14 |
|
|
|
e76f14 |
diff --git a/p2v/gui.c b/p2v/gui.c
|
|
|
e76f14 |
index a3b4af9..764b0f8 100644
|
|
|
e76f14 |
--- a/p2v/gui.c
|
|
|
e76f14 |
+++ b/p2v/gui.c
|
|
|
e76f14 |
@@ -1448,6 +1448,20 @@ create_running_dialog (void)
|
|
|
e76f14 |
gtk_text_buffer_create_tag (buf, tag_name, "foreground", tags[i], NULL);
|
|
|
e76f14 |
}
|
|
|
e76f14 |
|
|
|
e76f14 |
+#if GTK_CHECK_VERSION(3,16,0) /* gtk >= 3.16 */
|
|
|
e76f14 |
+ /* XXX This only sets the "CSS" style. It's not clear how to set
|
|
|
e76f14 |
+ * the particular font. However (by accident) this does at least
|
|
|
e76f14 |
+ * set the widget to use a monospace font.
|
|
|
e76f14 |
+ */
|
|
|
e76f14 |
+ GtkStyleContext *context = gtk_widget_get_style_context (v2v_output);
|
|
|
e76f14 |
+ gtk_style_context_add_class (context, "monospace");
|
|
|
e76f14 |
+#else
|
|
|
e76f14 |
+ PangoFontDescription *font;
|
|
|
e76f14 |
+ font = pango_font_description_from_string ("Monospace 11");
|
|
|
e76f14 |
+ gtk_widget_modify_font (v2v_output, font);
|
|
|
e76f14 |
+ pango_font_description_free (font);
|
|
|
e76f14 |
+#endif
|
|
|
e76f14 |
+
|
|
|
e76f14 |
log_label = gtk_label_new (NULL);
|
|
|
e76f14 |
gtk_misc_set_alignment (GTK_MISC (log_label), 0., 0.5);
|
|
|
e76f14 |
gtk_misc_set_padding (GTK_MISC (log_label), 10, 10);
|
|
|
e76f14 |
--
|
|
|
e76f14 |
1.8.3.1
|
|
|
e76f14 |
|