Changeset 5466
- Timestamp:
- 04/21/08 17:28:53 (4 weeks ago)
- Files:
-
- Spiral/trunk/English.lproj/Drill.nib/info.nib (modified) (1 diff)
- Spiral/trunk/English.lproj/Drill.nib/keyedobjects.nib (modified) (previous)
- Spiral/trunk/SPDrillListView.h (modified) (1 diff)
- Spiral/trunk/SPDrillListView.m (modified) (1 diff)
- Spiral/trunk/SPDrillView.h (modified) (1 diff)
- Spiral/trunk/SPDrillView.m (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Spiral/trunk/English.lproj/Drill.nib/info.nib
r5461 r5466 5 5 <key>IBFramework Version</key> 6 6 <string>629</string> 7 <key>IBLastKnownRelativeProjectPath</key> 8 <string>../../Spiral.xcodeproj</string> 7 9 <key>IBOldestOS</key> 8 10 <integer>5</integer> 9 11 <key>IBOpenObjects</key> 10 <array> 11 <integer>2</integer> 12 </array> 12 <array/> 13 13 <key>IBSystem Version</key> 14 14 <string>9C7010</string> Spiral/trunk/SPDrillListView.h
r5461 r5466 2 2 3 3 /* 4 * Copyright (c) 200 7Axel Andersson4 * Copyright (c) 2008 Axel Andersson 5 5 * All rights reserved. 6 6 * Spiral/trunk/SPDrillListView.m
r5465 r5466 2 2 3 3 /* 4 * Copyright (c) 200 7Axel Andersson4 * Copyright (c) 2008 Axel Andersson 5 5 * All rights reserved. 6 6 * Spiral/trunk/SPDrillView.h
r5461 r5466 2 2 3 3 /* 4 * Copyright (c) 2007 Axel Andersson4 * Copyright (c) 2007-2008 Axel Andersson 5 5 * All rights reserved. 6 6 * Spiral/trunk/SPDrillView.m
r5461 r5466 2 2 3 3 /* 4 * Copyright (c) 2007 Axel Andersson4 * Copyright (c) 2007-2008 Axel Andersson 5 5 * All rights reserved. 6 6 * … … 36 36 @interface SPDrillView(Private) 37 37 38 - (void)_addListViewWithItem:(id)item selectCurrentItem:(BOOL)selectCurrentItem; 38 - (void)_addListViewWithItem:(id)item transitionIn:(BOOL)transitionIn selectCurrentItem:(BOOL)selectCurrentItem; 39 - (void)_transitionInListViewFromView:(NSView *)view; 40 - (void)_transitionOutListViewFromView:(NSView *)view; 41 - (void)_transitionListViewFromView:(NSView *)view frame:(NSRect)frame; 39 42 40 43 @end … … 43 46 @implementation SPDrillView(Private) 44 47 45 - (void)_addListViewWithItem:(id)item selectCurrentItem:(BOOL)selectCurrentItem { 48 - (void)_addListViewWithItem:(id)item transitionIn:(BOOL)transitionIn selectCurrentItem:(BOOL)selectCurrentItem { 49 NSImageView *imageView; 50 NSImage *image; 51 NSBitmapImageRep *imageRep; 46 52 NSMutableArray *drillItems; 47 53 SPDrillItem *drillItem, *selectItem = NULL; … … 52 58 53 59 _currentListView = [[SPDrillListView alloc] initWithFrame:[SPDrillListView frameSizedToFitFromFrame:[self frame]]]; 60 [_currentListView setAlphaValue:0.0]; 61 [_currentListView setWantsLayer:YES]; 54 62 55 63 drillItems = [NSMutableArray array]; … … 78 86 79 87 [self addSubview:_currentListView]; 80 [previousListView removeFromSuperviewWithoutNeedingDisplay]; 88 89 if(previousListView) { 90 imageRep = [previousListView bitmapImageRepForCachingDisplayInRect:[previousListView visibleRect]]; 91 [previousListView cacheDisplayInRect:[previousListView visibleRect] toBitmapImageRep:imageRep]; 92 93 image = [[NSImage alloc] initWithSize:[imageRep size]]; 94 [image addRepresentation:imageRep]; 95 96 imageView = [[NSImageView alloc] initWithFrame:[previousListView frame]]; 97 [imageView setWantsLayer:YES]; 98 [imageView setImageScaling:NSScaleToFit]; 99 [imageView setImage:image]; 100 [self addSubview:imageView]; 101 102 [previousListView removeFromSuperview]; 103 104 if(transitionIn) 105 [self performSelector:@selector(_transitionInListViewFromView:) withObject:imageView afterDelay:0.05]; 106 else 107 [self performSelector:@selector(_transitionOutListViewFromView:) withObject:imageView afterDelay:0.05]; 108 109 [imageView release]; 110 } else { 111 [_currentListView setAlphaValue:1.0]; 112 } 113 114 [_currentListView release]; 115 } 116 117 118 119 - (void)_transitionInListViewFromView:(NSView *)view { 120 NSRect frame; 121 CGFloat factor; 122 123 frame = [view frame]; 124 factor = frame.size.height / frame.size.width; 125 frame.origin.x -= 150.0; 126 frame.origin.y -= factor * 150.0; 127 frame.size.width += 300.0; 128 frame.size.height += factor * 300.0; 129 130 [self _transitionListViewFromView:view frame:frame]; 131 } 132 133 134 135 - (void)_transitionOutListViewFromView:(NSView *)view { 136 NSRect frame; 137 CGFloat factor; 138 139 frame = [view frame]; 140 141 factor = frame.size.height / frame.size.width; 142 frame.origin.x += 150.0; 143 frame.origin.y += factor * 150.0; 144 frame.size.width -= 300.0; 145 frame.size.height -= factor * 300.0; 146 147 [self _transitionListViewFromView:view frame:frame]; 148 } 149 150 151 152 - (void)_transitionListViewFromView:(NSView *)view frame:(NSRect)frame { 153 [NSAnimationContext beginGrouping]; 154 [[NSAnimationContext currentContext] setDuration:0.2]; 155 [[view animator] setFrame:frame]; 156 [[view animator] setAlphaValue:0.0]; 157 [[_currentListView animator] setAlphaValue:1.0]; 158 [NSAnimationContext endGrouping]; 81 159 } 82 160 … … 92 170 [super dealloc]; 93 171 } 94 95 172 96 173 … … 116 193 _playlist = playlist; 117 194 118 [self _addListViewWithItem:playlist selectCurrentItem:NO]; 195 [_currentListView removeFromSuperview]; 196 _currentListView = NULL; 197 198 [self _addListViewWithItem:playlist transitionIn:NO selectCurrentItem:NO]; 119 199 } 120 200 … … 137 217 [[self delegate] drillView:self willOpenContainer:item]; 138 218 139 [self _addListViewWithItem:item selectCurrentItem:NO];219 [self _addListViewWithItem:item transitionIn:YES selectCurrentItem:NO]; 140 220 } 141 221 else if([item isKindOfClass:[SPPlaylistFile class]]) { … … 152 232 153 233 if(parentItem) 154 [self _addListViewWithItem:parentItem selectCurrentItem:YES];234 [self _addListViewWithItem:parentItem transitionIn:NO selectCurrentItem:YES]; 155 235 } 156 236
