Adjust layout parameters.

This commit is contained in:
Lukhnos D. Liu 2012-03-29 20:06:42 -07:00
parent 9c3623f19a
commit b0e7e7032f
2 changed files with 5 additions and 1 deletions

View File

@ -366,7 +366,7 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
_keyLabelStripView.keyLabels = [_keyLabels subarrayWithRange:NSMakeRange(0, keyLabelCount)]; _keyLabelStripView.keyLabels = [_keyLabels subarrayWithRange:NSMakeRange(0, keyLabelCount)];
_keyLabelStripView.labelOffsetY = (keyLabelFontSize >= candidateFontSize) ? 0.0 : floor((candidateFontSize - keyLabelFontSize) / 2.0); _keyLabelStripView.labelOffsetY = (keyLabelFontSize >= candidateFontSize) ? 0.0 : floor((candidateFontSize - keyLabelFontSize) / 2.0);
CGFloat rowHeight = ceil(fontSize * 1.20); CGFloat rowHeight = ceil(fontSize * 1.25);
[_tableView setRowHeight:rowHeight]; [_tableView setRowHeight:rowHeight];
CGFloat rowSpacing = [_tableView intercellSpacing].height; CGFloat rowSpacing = [_tableView intercellSpacing].height;

View File

@ -84,6 +84,10 @@
NSRect textRect = NSMakeRect(0.0, index * cellHeight + _labelOffsetY, bounds.size.width, cellHeight - _labelOffsetY); NSRect textRect = NSMakeRect(0.0, index * cellHeight + _labelOffsetY, bounds.size.width, cellHeight - _labelOffsetY);
NSRect cellRect = NSMakeRect(0.0, index * cellHeight, bounds.size.width, cellHeight - 1); NSRect cellRect = NSMakeRect(0.0, index * cellHeight, bounds.size.width, cellHeight - 1);
// fill in the last cell
if (index + 1 >= count) {
cellRect.size.height += 1.0;
}
if (index == _highlightedIndex) { if (index == _highlightedIndex) {
[darkGray setFill]; [darkGray setFill];