adium 3894:ccd2b155c06e: AIImageCollectionView will update the h...
commits at adium.im
commits at adium.im
Thu May 5 22:58:28 UTC 2011
details: http://hg.adium.im/adium/rev/ccd2b155c06e
revision: 3894:ccd2b155c06e
branch: (none)
author: Adrian Godoroja <robotive at me.com>
date: Fri May 06 01:58:10 2011 +0300
AIImageCollectionView will update the highlight when scrolling.
diffs (37 lines):
diff -r a56e7a4f0f4f -r ccd2b155c06e Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m Wed May 04 01:59:02 2011 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m Fri May 06 01:58:10 2011 +0300
@@ -179,7 +179,7 @@
#pragma mark -
/*!
- * We are registered to receive KVO notifiactions for "selectionIndexes"
+ * Handle KVO
*/
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
@@ -216,7 +216,7 @@
- (void)highlightItemAtIndex:(NSUInteger)anIndex
{
// Set highlight
- if (anIndex != NSNotFound && anIndex < [[self content] count] && [self highlightedIndex] != anIndex) {
+ if (anIndex != NSNotFound && anIndex < [[self content] count] && anIndex != [self highlightedIndex]) {
// Message delegate: Should Highlight
if ([[self delegate] respondsToSelector:@selector(imageCollectionView:shouldHighlightItemAtIndex:)]) {
if ([[self delegate] imageCollectionView:self shouldHighlightItemAtIndex:anIndex]) {
@@ -314,6 +314,15 @@
[self resetHighlight];
}
+- (void)scrollWheel:(NSEvent *)anEvent
+{
+ // Scrolling first
+ [super scrollWheel:anEvent];
+
+ // Highlight item
+ [self highlightItemAtIndex:[self indexAtPoint:[self convertPoint:[anEvent locationInWindow] fromView:nil]]];
+}
+
#pragma mark - Key Events
- (void)keyDown:(NSEvent *)anEvent
More information about the commits
mailing list