Skip to content

Commit

Permalink
HistoryView: Don't show path lines if the list is changed
Browse files Browse the repository at this point in the history
This avoids drawing path lines if the list is sorted
or if there is a search, which would show the lines incorrectly.
  • Loading branch information
pieter committed Sep 25, 2008
1 parent ff6cc26 commit 8c01a29
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
1 change: 1 addition & 0 deletions PBGitHistoryController.h
Expand Up @@ -40,4 +40,5 @@
- (IBAction) openSelectedFile: sender;
- (void) updateQuicklookForce: (BOOL) force;

- (BOOL) hasNonlinearPath;
@end
4 changes: 4 additions & 0 deletions PBGitHistoryController.m
Expand Up @@ -152,4 +152,8 @@ - (void) selectCommit: (NSString*) commit
[commitList scrollRowToVisible: index];
}

- (BOOL) hasNonlinearPath
{
return [commitController filterPredicate] || [[commitController sortDescriptors] count] > 0;
}
@end
25 changes: 21 additions & 4 deletions PBGitHistoryView.xib
Expand Up @@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">352.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="6"/>
<integer value="32"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -1312,6 +1312,14 @@
</object>
<int key="connectionID">109</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">controller</string>
<reference key="source" ref="977219207"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">110</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -1844,7 +1852,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">109</int>
<int key="maxID">110</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -1928,8 +1936,17 @@
<string key="className">PBGitRevisionCell</string>
<string key="superclassName">NSActionCell</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">objectValue</string>
<string key="NS.object.0">id</string>
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>controller</string>
<string>objectValue</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>PBGitHistoryController</string>
<string>id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
Expand Down
6 changes: 4 additions & 2 deletions PBGitRevisionCell.h
Expand Up @@ -9,11 +9,13 @@
#import <Cocoa/Cocoa.h>
#import "PBGitGrapher.h"
#import "PBGraphCellInfo.h"
#import "PBGitHistoryController.h"

@interface PBGitRevisionCell : NSActionCell {
id objectValue;
PBGraphCellInfo* cellInfo;
NSTextFieldCell* textCell;
PBGraphCellInfo *cellInfo;
NSTextFieldCell *textCell;
IBOutlet PBGitHistoryController *controller;
}

@property(retain) PBGitCommit* objectValue;
Expand Down
2 changes: 1 addition & 1 deletion PBGitRevisionCell.m
Expand Up @@ -180,7 +180,7 @@ - (void) drawWithFrame: (NSRect) rect inView:(NSView *)view
{
cellInfo = [self.objectValue lineInfo];

if (cellInfo) {
if (cellInfo && ![controller hasNonlinearPath]) {
float pathWidth = 10 + 10 * cellInfo.numColumns;

NSRect ownRect;
Expand Down

0 comments on commit 8c01a29

Please sign in to comment.