comparison finch/libgnt/gntentry.c @ 15959:efbced3f38ac

Update the tab completion a little bit. The binding for suggest-show will perform suggest-next if the suggest-dropdown is already showing. If there's just one suggestion, then complete with that suggestion.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 29 Mar 2007 01:26:24 +0000
parents 0e3a8505ebbe
children c31328dba5c2
comparison
equal deleted inserted replaced
15958:c44bb13db468 15959:efbced3f38ac
14 }; 14 };
15 static guint signals[SIGS] = { 0 }; 15 static guint signals[SIGS] = { 0 };
16 16
17 static GntWidgetClass *parent_class = NULL; 17 static GntWidgetClass *parent_class = NULL;
18 18
19 static gboolean gnt_entry_key_pressed(GntWidget *widget, const char *text);
19 static void gnt_entry_set_text_internal(GntEntry *entry, const char *text); 20 static void gnt_entry_set_text_internal(GntEntry *entry, const char *text);
20 21
21 static void 22 static void
22 destroy_suggest(GntEntry *entry) 23 destroy_suggest(GntEntry *entry)
23 { 24 {
319 } 320 }
320 321
321 static gboolean 322 static gboolean
322 suggest_show(GntBindable *bind, GList *null) 323 suggest_show(GntBindable *bind, GList *null)
323 { 324 {
324 return show_suggest_dropdown(GNT_ENTRY(bind)); 325 GntEntry *entry = GNT_ENTRY(bind);
326 if (entry->ddown) {
327 if (g_list_length(GNT_TREE(entry->ddown)->list) == 1)
328 gnt_entry_key_pressed(GNT_WIDGET(entry), "\r");
329 else
330 gnt_bindable_perform_action_named(GNT_BINDABLE(entry->ddown), "move-down");
331 return TRUE;
332 }
333 return show_suggest_dropdown(entry);
325 } 334 }
326 335
327 static gboolean 336 static gboolean
328 suggest_next(GntBindable *bind, GList *null) 337 suggest_next(GntBindable *bind, GList *null)
329 { 338 {