Permalink
Browse files

use vertical-list-like display for single-line-horizontal mode

  • Loading branch information...
scrod committed Mar 31, 2011
1 parent b6d50ec commit 8a8383fc099ea834203400f3de52cf9877502143
Showing with 6 additions and 5 deletions.
  1. +5 −4 NotesTableView.m
  2. +1 −1 UnifiedCell.m
View
@@ -307,22 +307,23 @@ - (void)_configureAttributesForCurrentLayout {
NSUInteger i;
for (i=0; i<[allColumns count]; i++) {
[[[allColumns objectAtIndex:i] dataCell] setFont:font];
- }
+ }
+ BOOL isOneRow = !horiz || (![globalPrefs tableColumnsShowPreview] && !ColumnIsSet(NoteLabelsColumn, [globalPrefs tableColumnsBitmap]));
if (IsLeopardOrLater)
- [self setSelectionHighlightStyle:horiz ? NSTableViewSelectionHighlightStyleSourceList : NSTableViewSelectionHighlightStyleRegular];
+ [self setSelectionHighlightStyle:isOneRow ? NSTableViewSelectionHighlightStyleRegular : NSTableViewSelectionHighlightStyleSourceList];
[self setBackgroundColor: horiz ? [NSColor colorWithCalibratedWhite:0.98 alpha:1.0] : [NSColor whiteColor]];
NSLayoutManager *lm = [[NSLayoutManager alloc] init];
tableFontHeight = [lm defaultLineHeightForFont:font];
- float h[4] = {(tableFontHeight * 3.0 + 5.0f), (tableFontHeight * 2.0 + 6.0f), (tableFontHeight + 4.0f), tableFontHeight + 2.0f};
+ float h[4] = {(tableFontHeight * 3.0 + 5.0f), (tableFontHeight * 2.0 + 6.0f), (tableFontHeight + 2.0f), tableFontHeight + 2.0f};
[self setRowHeight: horiz ? ([globalPrefs tableColumnsShowPreview] ? h[0] :
(ColumnIsSet(NoteLabelsColumn,[globalPrefs tableColumnsBitmap]) ? h[1] : h[2])) : h[3]];
[lm release];
[self setIntercellSpacing:NSMakeSize(12, 2)];
- [self setGridStyleMask:horiz ? NSTableViewSolidHorizontalGridLineMask : NSTableViewGridNone];
+ [self setGridStyleMask:isOneRow ? NSTableViewGridNone : NSTableViewSolidHorizontalGridLineMask];
[self setGridColor:[NSColor colorWithCalibratedWhite:0.882 alpha:1.0]];
}
View
@@ -184,7 +184,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSColor *textColor = ([self isHighlighted] && isActive) ? [NSColor whiteColor] : (![self isHighlighted] ? [[self class] dateColorForTint]/*[NSColor grayColor]*/ : nil);
if (textColor)
[baseAttrs setObject:textColor forKey:NSForegroundColorAttributeName];
- if (IsSnowLeopardOrLater && [self isHighlighted]) {
+ if (IsSnowLeopardOrLater && [self isHighlighted] && ([tv selectionHighlightStyle] == NSTableViewSelectionHighlightStyleSourceList)) {
[baseAttrs setObject:ShadowForSnowLeopard() forKey:NSShadowAttributeName];
}

0 comments on commit 8a8383f

Please sign in to comment.