From 6b84271314eac1431936513e1b38f1773643a48a Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 10 Apr 2010 15:48:09 +0000 Subject: [PATCH] when removing the bottom group, select the group above it instead of the first group --- macosx/GroupsPrefsController.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/macosx/GroupsPrefsController.m b/macosx/GroupsPrefsController.m index 01b4b825c..9a3db3893 100644 --- a/macosx/GroupsPrefsController.m +++ b/macosx/GroupsPrefsController.m @@ -168,9 +168,16 @@ [fTableView reloadData]; - NSInteger selectedRow = [fTableView selectedRow]; - if (selectedRow != -1) - [fTableView scrollRowToVisible: selectedRow]; + if ([fTableView numberOfRows] > 0) + { + if (row == [fTableView numberOfRows]) + { + --row; + [fTableView selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO]; + } + + [fTableView scrollRowToVisible: row]; + } break; }