commit e9519f7e89c9cb870b15cbdb02b4668d7f8fb58a
parent 16aa94775b0fbe308e37414589384837839515e7
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:
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c
@@ -331,7 +331,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
@@ -1304,6 +1304,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
@@ -586,6 +586,9 @@ struct _PrefsCommon
/* Proxy */
gboolean use_proxy;
ProxyInfo proxy_info;
+
+ /* Quicksearch */
+ guint qs_press_timeout;
};
extern PrefsCommon prefs_common;