diff options
author | 2009-12-30 20:19:00 +0100 | |
---|---|---|
committer | 2009-12-30 20:19:00 +0100 | |
commit | 3c795a6339f5ee1d5b8c6e294e2aec5fee77b45b (patch) | |
tree | fec35b257c8fadb2a2894a8a52ae7110aff66d16 /plugins/gtkui | |
parent | ad64707757fda99d212a23b82a65aa37525ad851 (diff) |
fixed few keyboard navigation conflicts in search window
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/gtkplaylist.c | 26 | ||||
-rw-r--r-- | plugins/gtkui/gtkplaylist.h | 3 | ||||
-rw-r--r-- | plugins/gtkui/search.c | 9 |
3 files changed, 12 insertions, 26 deletions
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c index 097d1c28..1ddd02ea 100644 --- a/plugins/gtkui/gtkplaylist.c +++ b/plugins/gtkui/gtkplaylist.c @@ -896,7 +896,7 @@ main_refresh (void) { } } -void +int gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) { GtkWidget *range = ps->scrollbar; int prev = deadbeef->pl_get_cursor (ps->iterator); @@ -954,7 +954,7 @@ gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) { search_refresh (); } else { - return; + return 0 ; } if (state & GDK_SHIFT_MASK) { if (cursor != prev) { @@ -992,28 +992,8 @@ gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) { else { shift_sel_anchor = cursor; gtkpl_set_cursor (ps->iterator, cursor); -#if 0 - // reset selection, set new single cursor and selection - if (prev != deadbeef->pl_get_cursor (ps->iterator)) { - int idx=0; - for (DB_playItem_t *it = PL_HEAD (ps->iterator); it; it = PL_NEXT(it, ps->iterator), idx++) { - if (idx == cursor) { - if (!SELECTED (it)) { - VSELECT (it, 1); - } - } - else if (SELECTED (it)) { - VSELECT (it, 0); - } - } - } -#endif } -#if 0 - if (newscroll != ps->scrollpos) { - gtk_range_set_value (GTK_RANGE (range), newscroll); - } -#endif + return 1; } static int drag_motion_y = -1; diff --git a/plugins/gtkui/gtkplaylist.h b/plugins/gtkui/gtkplaylist.h index ebf27f99..33998824 100644 --- a/plugins/gtkui/gtkplaylist.h +++ b/plugins/gtkui/gtkplaylist.h @@ -144,7 +144,8 @@ gtkpl_hscroll (gtkplaylist_t *ps, int newscroll); void gtkpl_handle_scroll_event (gtkplaylist_t *ps, int direction); -void +// returns 1 if keypress was handled, 0 otherwise +int gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state); void diff --git a/plugins/gtkui/search.c b/plugins/gtkui/search.c index 0c45125d..a4506622 100644 --- a/plugins/gtkui/search.c +++ b/plugins/gtkui/search.c @@ -188,10 +188,15 @@ on_searchwin_key_press_event (GtkWidget *widget, } } } + else if (event->keyval != GDK_Delete && event->keyval != GDK_Home && event->keyval != GDK_End){ + if (!gtkpl_keypress (&search_playlist, event->keyval, event->state)) { + return FALSE; + } + } else { - gtkpl_keypress (&search_playlist, event->keyval, event->state); + return FALSE; } - return FALSE; + return TRUE; } |