talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit d154d3fe780aad5214661c9f01f323ececa16d44
parent 305feef56cb0cf88bbc342e03623212f94ac5759
Author: wwp <subscript@free.fr>
Date:   Sun,  6 Feb 2022 11:23:05 +0100

Make the quicksearch type-ahead keypress delay (before triggering
the search) customizable using a hidden preference.

Diffstat:
Msrc/gtk/quicksearch.c | 2+-
Msrc/prefs_common.c | 3+++
Msrc/prefs_common.h | 3+++
3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c @@ -315,7 +315,7 @@ static void searchbar_changed_cb(GtkWidget *widget, QuickSearch *qs) if (qs->press_timeout_id != 0) { g_source_remove(qs->press_timeout_id); } - qs->press_timeout_id = g_timeout_add(500, + qs->press_timeout_id = g_timeout_add(prefs_common.qs_press_timeout, searchbar_changed_timeout, qs); } diff --git a/src/prefs_common.c b/src/prefs_common.c @@ -1308,6 +1308,9 @@ static PrefParam param[] = { {"proxy_name", "", &prefs_common.proxy_info.proxy_name, P_STRING, NULL, NULL, NULL}, {"proxy_pass", NULL, &prefs_common.proxy_info.proxy_pass, P_STRING, NULL, NULL, NULL}, + {"qs_press_timeout", "500", &prefs_common.qs_press_timeout, P_INT, + NULL, NULL, NULL}, + {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL} }; diff --git a/src/prefs_common.h b/src/prefs_common.h @@ -588,6 +588,9 @@ struct _PrefsCommon /* Proxy */ gboolean use_proxy; ProxyInfo proxy_info; + + /* Quicksearch */ + guint qs_press_timeout; }; extern PrefsCommon prefs_common;