Commit 82c0d537 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

smart list: fix row selection

Do not change row selection on interaction status updated.

Change-Id: I8deb6b5558429d8054a7e647b0a59ad6f0541c31
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 77a50d57
...@@ -380,15 +380,16 @@ NSInteger const REQUEST_SEG = 1; ...@@ -380,15 +380,16 @@ NSInteger const REQUEST_SEG = 1;
- (void)tableViewSelectionDidChange:(NSNotification *)notification - (void)tableViewSelectionDidChange:(NSNotification *)notification
{ {
NSInteger row = [notification.object selectedRow]; NSInteger row = [notification.object selectedRow];
NSInteger rows = [smartView numberOfRows];
[smartView enumerateAvailableRowViewsUsingBlock:^(NSTableRowView *rowView, NSInteger row){ for (int i = 0; i< rows; i++) {
NSTableRowView* cellRowView = [smartView rowViewAtRow:row makeIfNecessary:NO]; NSTableRowView* cellRowView = [smartView rowViewAtRow:i makeIfNecessary:YES];
if(rowView.selected){ if (i == row) {
cellRowView.backgroundColor = [NSColor controlColor]; cellRowView.backgroundColor = [NSColor controlColor];
}else{ } else {
cellRowView.backgroundColor = [NSColor whiteColor]; cellRowView.backgroundColor = [NSColor whiteColor];
} }
}]; }
if (row == -1) if (row == -1)
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment