[code] Proof of concept patch for Linux

From: Pedro Andres Aranda Gutierrez <paaguti.att.gmail.com>
Date: Sun, 26 Jul 2020 09:09:24 +0200

Hi,

I've been investigating a bit about the monospaced find dialog. The
following patch does the trick for Linux. I have tested it on GTK3, which
is what I use. Apparently, it is backwards-compatible with GTK2.

diff -r 987b900348bf src/textadept.c
--- a/src/textadept.c Sun Jul 26 00:00:07 2020 -0400
+++ b/src/textadept.c Sun Jul 26 09:05:05 2020 +0200
@@ -2170,8 +2170,15 @@
   gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(combo), false);
   *entry = gtk_bin_get_child(GTK_BIN(combo));
   gtk_entry_set_text(GTK_ENTRY(*entry), " "),
- gtk_entry_set_text(GTK_ENTRY(*entry), ""); // initialize with non-NULL
+ gtk_entry_set_text(GTK_ENTRY(*entry), ""); // initialize with
non-NULL
   gtk_entry_set_activates_default(GTK_ENTRY(*entry), true);
+
+ // Make text extry monospace
+ PangoFontDescription *font_desc = pango_font_description_new();
+ pango_font_description_set_family(font_desc,"monospace");
+ gtk_widget_modify_font (*entry, font_desc);
+ pango_font_description_free(font_desc);
+
   gtk_label_set_mnemonic_widget(GTK_LABEL(*label), *entry);
   return combo;
 }

Small screen capture too :-)

[image: textadept-mono-find.png]

Best, /PA

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellet zu werden
Georg Kreisler

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
textadept-mono-find.png
Received on Sun 26 Jul 2020 - 03:09:24 EDT

This archive was generated by hypermail 2.2.0 : Sun 26 Jul 2020 - 06:49:03 EDT