Permalink
Browse files

little bit more

  • Loading branch information...
1 parent d02d4a0 commit e7b8088bac8d4ff9e8fec73889f0a8baa2488c8d @elasticthreads elasticthreads committed Apr 24, 2013
Showing with 11 additions and 37 deletions.
  1. +8 −31 AppController.m
  2. +2 −5 NSString_CustomTruncation.m
  3. +1 −1 UnifiedCell.m
View
@@ -2354,41 +2354,16 @@ - (NSWindow*)window {
#pragma mark nvALT methods
-//- (NSCell *)tableView:(NSTableView *)aTableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex {
-// NSTextFieldCell *aCell = [tableColumn dataCell];
-// if (aTableView==notesTableView) {
-// if (!self.isEditing&&[aCell isHighlighted]) {
-// CGFloat white=[[foregrndColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] whiteComponent];
-// if (([window firstResponder]==notesTableView)||[prefsController horizontalLayout]) {
-// [aCell setTextColor:[NSColor whiteColor]];
-// return aCell;
-// }else if (white>0.5) {
-// [aCell setTextColor:[NSColor colorWithCalibratedWhite:0.2 alpha:1.0]];
-// return aCell;
-// }
-// }
-// [aCell setTextColor:foregrndColor];
-// }
-// return aCell;
-//}
-
-
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {
if (aTableView==notesTableView) {
- if ([aCell isHighlighted]) {
- if (!self.isEditing) {
- CGFloat white=[[foregrndColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] whiteComponent];
- if (([window firstResponder]==notesTableView)||([notesTableView rowHeight]>30.0)) {
- [aCell setTextColor:[NSColor whiteColor]];
- return;
- }else if (white>0.5) {
- [aCell setTextColor:[NSColor colorWithCalibratedWhite:0.2 alpha:1.0]];
- return;
- }
- }else if ([notesTableView editedRow]==rowIndex){
+ if ([aCell isHighlighted]) {
+ if (([window firstResponder]==notesTableView)||([notesTableView rowHeight]>30.0)||(isEditing&&([notesTableView editedRow]==rowIndex))) {
[aCell setTextColor:[NSColor whiteColor]];
return;
- }
+ }else if ([[foregrndColor colorUsingColorSpaceName:NSCalibratedWhiteColorSpace] whiteComponent]>0.5) {
+ [aCell setTextColor:[NSColor colorWithCalibratedWhite:0.2 alpha:1.0]];
+ return;
+ }
}
[aCell setTextColor:foregrndColor];
}
@@ -2925,6 +2900,7 @@ - (void)updateFieldAttributes{
if (self.isEditing) {
[theFieldEditor setDrawsBackground:NO];
+ [theFieldEditor setTextColor:foregrndColor];
// [theFieldEditor setBackgroundColor:backgrndColor];
[theFieldEditor setSelectedTextAttributes:fieldAttributes];
[theFieldEditor setInsertionPointColor:foregrndColor];
@@ -3232,6 +3208,7 @@ - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client{
}
[theFieldEditor setDrawsBackground:NO];
// [theFieldEditor setBackgroundColor:backgrndColor];
+ [theFieldEditor setTextColor:foregrndColor];
[theFieldEditor setSelectedTextAttributes:fieldAttributes];
[theFieldEditor setInsertionPointColor:foregrndColor];
@@ -125,12 +125,9 @@ void ResetFontRelatedTableAttributes() {
//account for right-"aligned" date string, which will be relatively constant, so this can be cached
NSString *dateTest=[NSString relativeDateStringWithAbsoluteTime:CFDateGetAbsoluteTime((CFDateRef)[NSDate dateWithNaturalLanguageString:@"April 1, 2013"])];
- CGFloat multiplier=-4.6;
+ CGFloat multiplier=-4.7;
if (dateTest&&(dateTest.length>8)) {
- multiplier-=((CGFloat)dateTest.length-8.0);
- if (multiplier<-6.5) {
- multiplier=-6.5;
- }
+ multiplier=-6.1;
}
[[titleTruncAttrs objectForKey:NSParagraphStyleAttributeName] setTailIndent: fontSize * multiplier]; //avg of -55 for ~11-12 font size
}
View
@@ -205,7 +205,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSString *dateStr = (showDateCreated ? dateCreatedStringOfNote : dateModifiedStringOfNote)(tv, noteObject, NSNotFound);
CGFloat dateLength=70.0;
if (dateStr.length>8) {
- dateLength+=((dateStr.length-8.0)*2);
+ dateLength+=(((CGFloat)dateStr.length-8.0)*2);
}
[dateStr drawInRect:NSMakeRect(NSMaxX(cellFrame) - dateLength-4.0, NSMinY(cellFrame), dateLength, fontHeight) withAttributes:baseAttrs];
}

0 comments on commit e7b8088

Please sign in to comment.