Skip to content

Commit

Permalink
Fix for issue 18: Distinguish between listviews with and without focus
Browse files Browse the repository at this point in the history
  • Loading branch information
rretzbach committed Jul 26, 2011
1 parent a74036f commit a2c6005
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Controllers/COMessageController.h
Expand Up @@ -13,6 +13,8 @@


@interface COMessageController : COListController {

IBOutlet PXListView *parentView;

}

Expand Down
4 changes: 3 additions & 1 deletion Controllers/COMessageController.m
Expand Up @@ -23,7 +23,9 @@ - (void)listViewSelectionDidChange:(NSNotification *)aNotification {
NSIndexSet *selectedRows = [aListView selectedRows];
// select items in arraycontroller
[self setSelectionIndexes:selectedRows];


// redraw parent's selected row to show that it has lost focus
[[parentView cellForRowAtIndex:[parentView selectedRow]] setNeedsDisplay:YES];
}

- (void)addReplyToMessage:(COMessage *)message {
Expand Down
21 changes: 20 additions & 1 deletion Resources/MainMenu.xib
Expand Up @@ -2634,6 +2634,14 @@
</object>
<int key="connectionID">771</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">parentView</string>
<reference key="source" ref="1043421619"/>
<reference key="destination" ref="185493560"/>
</object>
<int key="connectionID">772</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -4443,7 +4451,7 @@
<reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
<int key="maxID">771</int>
<int key="maxID">772</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -4508,6 +4516,17 @@
<object class="IBPartialClassDescription">
<string key="className">COMessageController</string>
<string key="superclassName">COListController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">parentView</string>
<string key="NS.object.0">PXListView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">parentView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">parentView</string>
<string key="candidateClassName">PXListView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/COMessageController.h</string>
Expand Down
8 changes: 7 additions & 1 deletion UI/COManagedViewCell.m
Expand Up @@ -21,8 +21,14 @@ @implementation COManagedViewCell
@synthesize objectController;

- (void)drawRect:(NSRect)dirtyRect {

if ([self isSelected]) {
[[NSColor selectedControlColor] set];
id obj = [[NSApp mainWindow] firstResponder];
if ([self listView] == obj) {
[[NSColor selectedControlColor] set];
} else {
[[NSColor secondarySelectedControlColor] set];
}
}
else {
[[NSColor whiteColor] set];
Expand Down

0 comments on commit a2c6005

Please sign in to comment.