Implemented focus rings around cell so editable cells in a NSTableView appear by default with a focus ring when being edited. Some minor adjustments will be required to make it work perfectly with other controls, such as NSMatrix, NSForm, and NSPopUpButton.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36066 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Frank Le Grand 2013-02-06 20:32:45 +00:00
parent 21e571b923
commit bca3428387
6 changed files with 73 additions and 18 deletions

View file

@ -968,7 +968,11 @@ static NSImage *unexpandable = nil;
tb = [_tableColumns objectAtIndex: i];
cell = [self _dataCellForTableColumn: tb row: rowIndex];
if (i == _editedColumn && rowIndex == _editedRow)
[cell _setInEditing: YES];
{
[cell _setInEditing: YES];
[cell setShowsFirstResponder:YES];
[cell setFocusRingType:NSFocusRingTypeDefault];
}
[self _willDisplayCell: cell
forTableColumn: tb
row: rowIndex];
@ -1035,7 +1039,11 @@ static NSImage *unexpandable = nil;
[cell drawWithFrame: drawingRect inView: self];
if (i == _editedColumn && rowIndex == _editedRow)
[cell _setInEditing: NO];
{
[cell _setInEditing: NO];
[cell setShowsFirstResponder:NO];
[cell setFocusRingType:NSFocusRingTypeDefault];
}
}
}
@ -1613,8 +1621,7 @@ Also returns the child index relative to this parent. */
}
_textObject = [_editedCell setUpFieldEditorAttributes: t];
// FIXME: Which background color do we want here?
[_textObject setBackgroundColor: [NSColor selectedControlColor]];
[_textObject setBackgroundColor: [NSColor textBackgroundColor]];
[_textObject setDrawsBackground: YES];
drawingRect = [self frameOfCellAtColumn: columnIndex row: rowIndex];