From 41cfd1ccae96dda3378b9666e38e70e547fe87f2 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 Nov 2019 20:11:02 +0100 Subject: Show selected completion as a inline-selection --- bookmarks.c | 7 ++++++- config.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bookmarks.c b/bookmarks.c index 4bbfb8a..8a69814 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -1,13 +1,17 @@ #include "bookmarks.h" #include "badwolf.h" +#include "config.h" #include /* g_fprintf() */ #include #include gboolean -location_completion_matches(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer user_data) +location_completion_matches(GtkEntryCompletion *completion, + const gchar *key, + GtkTreeIter *iter, + gpointer user_data) { (void)user_data; gchar *buffer; @@ -30,6 +34,7 @@ location_completion_setup(GtkListStore *list_store) gtk_entry_completion_set_model(location_completion, GTK_TREE_MODEL(list_store)); gtk_entry_completion_set_text_column(location_completion, 0); gtk_entry_completion_set_match_func(location_completion, location_completion_matches, NULL, NULL); + gtk_entry_completion_set_inline_selection(location_completion, BADWOLF_LOCATION_INLINE_SELECTION); } void diff --git a/config.h b/config.h index 8426ce3..6bd76df 100644 --- a/config.h +++ b/config.h @@ -104,4 +104,7 @@ */ #define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE +// BADWOLF_LOCATION_INLINE_SELECTION: show selected completion as a selection in location entry +#define BADWOLF_LOCATION_INLINE_SELECTION TRUE + #endif /* CONFIG_H_INCLUDED */ -- cgit v1.3.1-23-gd82d