summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-01-03 04:19:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-03 21:52:30 -0800
commitfc882f574febd5eb3387d33edc5f1f81ab93c0ea (patch)
treefd7f937f5442ea0dfd536f81dbc293ace88b5a45 /gtk-gui.c
parente5e2fb2038321a645be58497fdbccb30e321264c (diff)
downloadsubsurface-fc882f574febd5eb3387d33edc5f1f81ab93c0ea.tar.gz
Improvements to select_prev_dive() and select_next_dive()
There were some minor problems when moving the selection cursor around: 1) If the selection was larger than 1, it was possible for the selection to get "stuck" in the middle of the list. This patch approaches this by always calling gtk_tree_selection_unselect_all() before gtk_tree_selection_select_iter(), or simply always making sure we have one selected iterator when navigating with the keys. 2) When there was a single top level dive before the first trip it wasn't possible to navigate trough the child dives of said trip in both directions. The patch attempts to fix this by having the hunks/checks: if (idx < 0) { (idx is of a trip) performed regardless of other conditions. *** Note: testing was done by importing all test*.xml dives with auto-group on. [Dirk Hohndel: adjusted the patch to also fix on_key_press to only grab the key if no modifier key is pressed; otherwise this breaks shift-cursor-keys for selecting multiple dives.] Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 7c63a49b0..43e0d14e7 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1147,7 +1147,7 @@ static void switch_page(GtkNotebook *notebook, gint arg1, gpointer user_data)
static gboolean on_key_press(GtkWidget *w, GdkEventKey *event, GtkWidget *divelist)
{
- if (event->type != GDK_KEY_PRESS)
+ if (event->type != GDK_KEY_PRESS || event->state != 0)
return FALSE;
switch (event->keyval) {
case GDK_Up: