Kaydet (Commit) c4679ead authored tarafından Enrico Tröger's avatar Enrico Tröger

Use monospace font for text entry fields in search dialogs and add a notice how…

Use monospace font for text entry fields in search dialogs and add a notice how to change the used font (#1907117).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2328 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 7893d465
This diff is collapsed.
......@@ -840,6 +840,30 @@ matching lines will be highlighted. Markers and highlighting can be
removed by selecting the Remove Markers command from the Document menu.
Change font in search dialog text fields
````````````````````````````````````````
All search related dialogs use a Monospace for the text input fields to
increase the readibility of input text. This is useful when you are
typing e.g. regular expressions with spaces, periods and commas which
might it hard to read with a proportional font.
If you want to change the font for some reason, you can do this easily
by inserting the following style into your ``.gtkrc-2.0``
(usually found in your home directory on UNIX-like systems and in the
etc subdirectory of your Geany installation on Windows)::
style "search_style"
{
font_name="Monospace 8"
}
widget "GeanyDialogSearch.*.GtkEntry" style:highest "search_style"
Please note the addition ":highest" in the last line which sets the priority
of this style to the highest available. Otherwise, the style is ignored
for the search dialogs.
Find usage
^^^^^^^^^^
......
......@@ -259,6 +259,28 @@ void search_find_selection(gint idx, gboolean search_backwards)
}
/* this will load a GTK rc style to set a monospace font for text fields(GtkEntry) in all
* search dialogs. This needs to be done only once.
* The monospace font should increase readibility of regular expressions containing spaces, points,
* commas and similar (#1907117). */
static void load_monospace_style()
{
static const gchar *rcstyle =
"style \"geany-monospace\"\n" \
"{\n" \
" font_name=\"Monospace 16\"\n" \
"}\n" \
"widget \"GeanyDialogSearch.*.GtkEntry\" style \"geany-monospace\"";
static gboolean load = TRUE;
if (load)
{
gtk_rc_parse_string(rcstyle);
load = FALSE;
}
}
void search_show_find_dialog(void)
{
gint idx = document_get_cur_idx();
......@@ -274,6 +296,8 @@ void search_show_find_dialog(void)
GtkWidget *exp, *bbox, *button, *check_close;
GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips"));
load_monospace_style();
widgets.find_dialog = gtk_dialog_new_with_buttons(_("Find"),
GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL);
......@@ -394,6 +418,8 @@ void search_show_replace_dialog(void)
GtkSizeGroup *label_size;
GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips"));
load_monospace_style();
widgets.replace_dialog = gtk_dialog_new_with_buttons(_("Replace"),
GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL);
......@@ -542,6 +568,8 @@ void search_show_find_in_files_dialog(const gchar *dir)
GtkSizeGroup *size_group;
GtkTooltips *tooltips = GTK_TOOLTIPS(lookup_widget(app->window, "tooltips"));
load_monospace_style();
widgets.find_in_files_dialog = gtk_dialog_new_with_buttons(
_("Find in Files"), GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment