Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NSTableView+RSAutosaving.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

extern NSString * const RSAutosavingColumnWidthKey;
extern NSString * const RSAutosavingColumnIndexKey;
extern NSString* const RSAutosavingColumnHiddenKey;

@interface NSTableView (RSAutosaving)
- (NSDictionary *)dictionaryForAutosavingLayout;
Expand Down
6 changes: 6 additions & 0 deletions NSTableView+RSAutosaving.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

NSString * const RSAutosavingColumnWidthKey = @"AutosavedColumnWidth";
NSString * const RSAutosavingColumnIndexKey = @"AutosavedColumnIndex";
NSString* const RSAutosavingColumnHiddenKey = @"AutosavedColumnHidden";


@interface NSDictionary (RSTableViewAutosaving)
- (NSComparisonResult)compareByAutosavedIndex:(NSDictionary *)otherDict;
Expand Down Expand Up @@ -46,6 +48,7 @@ - (NSDictionary *)dictionaryForAutosavingLayout
NSInteger thisColIndex = [self columnWithIdentifier:thisColID];
NSNumber *thisIndex = @(thisColIndex);
thisColDict[RSAutosavingColumnIndexKey] = thisIndex;
thisColDict[RSAutosavingColumnHiddenKey] = @(thisCol.isHidden);

// Add it all to the big dict
autoDict[thisColID] = thisColDict;
Expand Down Expand Up @@ -93,6 +96,9 @@ - (void)adjustLayoutForAutosavedDictionary:(NSDictionary *)theDict
thisCol.width = (CGFloat)columnWidthNum.doubleValue;
#endif
thisCol.resizingMask = saveMask;

if(thisColDict[RSAutosavingColumnHiddenKey])
thisCol.hidden = [thisColDict[RSAutosavingColumnHiddenKey] boolValue];
}
}
}
Expand Down