From 6287bb1af4c0a714b6133a5068dcd7791b1ec969 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 11 Dec 2000 23:55:26 +0000 Subject: Autoselect the rule that ends up in the same position (or the one above it 2000-12-11 Jeffrey Stedfast * vfolder-editor.c (rule_delete): Autoselect the rule that ends up in the same position (or the one above it if the list is shorter than the position). svn path=/trunk/; revision=6926 --- filter/ChangeLog | 6 ++++++ filter/vfolder-editor.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/filter/ChangeLog b/filter/ChangeLog index 341ba297b1..92825b84dd 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,9 @@ +2000-12-11 Jeffrey Stedfast + + * vfolder-editor.c (rule_delete): Autoselect the rule that ends up + in the same position (or the one above it if the list is shorter + than the position). + 2000-12-08 Jeffrey Stedfast * filter-rule.c (get_widget): Don't highlight the title if it's diff --git a/filter/vfolder-editor.c b/filter/vfolder-editor.c index 0f17005e6e..1b2022fecb 100644 --- a/filter/vfolder-editor.c +++ b/filter/vfolder-editor.c @@ -226,7 +226,7 @@ rule_edit (GtkWidget *widget, struct _editor_data *data) static void rule_delete (GtkWidget *widget, struct _editor_data *data) { - int pos; + int pos, len; GList *l; GtkListItem *item; @@ -242,6 +242,11 @@ rule_delete (GtkWidget *widget, struct _editor_data *data) gtk_object_unref (GTK_OBJECT (data->current)); data->current = NULL; + + /* select the item in the same position or 1-up */ + len = g_list_length (data->list->children); + pos = pos >= len ? len - 1: pos; + gtk_list_select_item (data->list, pos); } set_sensitive (data); -- cgit v1.2.3