From: Daniel Carl Date: Tue, 16 Jul 2013 21:11:59 +0000 (+0200) Subject: Allow to enable/disable title in completions on compile time. X-Git-Url: https://git.owens.tech/git.owens.tech/git.owens.tech/git?a=commitdiff_plain;h=83b24e598c41ba6401d758f201ba242cf4b95cbc;p=vimb.git Allow to enable/disable title in completions on compile time. --- diff --git a/config.mk b/config.mk index e9a41e5..3217c87 100644 --- a/config.mk +++ b/config.mk @@ -13,6 +13,7 @@ CPPFLAGS += -DFEATURE_COOKIE CPPFLAGS += -DFEATURE_SEARCH_HIGHLIGHT CPPFLAGS += -DFEATURE_NO_SCROLLBARS #CPPFLAGS += -DFEATURE_GTK_PROGRESSBAR +CPPFLAGS += -DFEATURE_TITLE_IN_COMPLETION LIBS = libsoup-2.4 diff --git a/src/bookmark.c b/src/bookmark.c index 1f1b6cd..84ce880 100644 --- a/src/bookmark.c +++ b/src/bookmark.c @@ -122,7 +122,10 @@ gboolean bookmark_fill_completion(GtkListStore *store, const char *input) gtk_list_store_set( store, &iter, COMPLETION_STORE_FIRST, bm->uri, - COMPLETION_STORE_SECOND, bm->title, -1 +#ifdef FEATURE_TITLE_IN_COMPLETION + COMPLETION_STORE_SECOND, bm->title, +#endif + -1 ); found = true; } @@ -139,7 +142,10 @@ gboolean bookmark_fill_completion(GtkListStore *store, const char *input) gtk_list_store_set( store, &iter, COMPLETION_STORE_FIRST, bm->uri, - COMPLETION_STORE_SECOND, bm->title, -1 +#ifdef FEATURE_TITLE_IN_COMPLETION + COMPLETION_STORE_SECOND, bm->title, +#endif + -1 ); found = true; } diff --git a/src/completion.c b/src/completion.c index eb79209..b1ce400 100644 --- a/src/completion.c +++ b/src/completion.c @@ -178,6 +178,7 @@ static void init_completion(GtkTreeModel *model) gtk_tree_view_column_set_min_width(column, 2 * width/3); /* prepare second column */ +#ifdef FEATURE_TITLE_IN_COMPLETION column = gtk_tree_view_column_new(); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_append_column(GTK_TREE_VIEW(comp.tree), column); @@ -190,6 +191,7 @@ static void init_completion(GtkTreeModel *model) ); gtk_tree_view_column_pack_start(column, renderer, true); gtk_tree_view_column_add_attribute(column, renderer, "text", COMPLETION_STORE_SECOND); +#endif /* use max 1/3 of window height for the completion */ #ifdef HAS_GTK3 diff --git a/src/completion.h b/src/completion.h index 7a3ea26..e628b39 100644 --- a/src/completion.h +++ b/src/completion.h @@ -24,7 +24,9 @@ enum { COMPLETION_STORE_FIRST, +#ifdef FEATURE_TITLE_IN_COMPLETION COMPLETION_STORE_SECOND, +#endif COMPLETION_STORE_NUM }; diff --git a/src/history.c b/src/history.c index d09d2a9..8072962 100644 --- a/src/history.c +++ b/src/history.c @@ -141,7 +141,10 @@ gboolean history_fill_completion(GtkListStore *store, HistoryType type, const ch gtk_list_store_set( store, &iter, COMPLETION_STORE_FIRST, item->first, - COMPLETION_STORE_SECOND, item->second, -1 +#ifdef FEATURE_TITLE_IN_COMPLETION + COMPLETION_STORE_SECOND, item->second, +#endif + -1 ); found = true; } @@ -156,7 +159,10 @@ gboolean history_fill_completion(GtkListStore *store, HistoryType type, const ch gtk_list_store_set( store, &iter, COMPLETION_STORE_FIRST, item->first, - COMPLETION_STORE_SECOND, item->second, -1 +#ifdef FEATURE_TITLE_IN_COMPLETION + COMPLETION_STORE_SECOND, item->second, +#endif + -1 ); found = true; } @@ -170,7 +176,10 @@ gboolean history_fill_completion(GtkListStore *store, HistoryType type, const ch gtk_list_store_set( store, &iter, COMPLETION_STORE_FIRST, item->first, - COMPLETION_STORE_SECOND, item->second, -1 +#ifdef FEATURE_TITLE_IN_COMPLETION + COMPLETION_STORE_SECOND, item->second, +#endif + -1 ); found = true; }