Changeset 24064
- Timestamp:
- 06/24/2008 07:33:04 PM (5 months ago)
- Files:
-
- trunk/Source/KNShelfSplitView.h (modified) (1 diff)
- trunk/Source/KNShelfSplitView.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Source/KNShelfSplitView.h
r20915 r24064 47 47 NSColor * shelfBackgroundColor; 48 48 float currentShelfWidth; 49 float prevShelfWidthBeforeDoubleClick; 49 50 BOOL isShelfVisible; 50 51 NSMenu * contextButtonMenu; trunk/Source/KNShelfSplitView.m
r22238 r24064 85 85 86 86 currentShelfWidth = DEFAULT_SHELF_WIDTH; //change this 87 prevShelfWidthBeforeDoubleClick = currentShelfWidth; 87 88 isShelfVisible = YES; 88 89 shouldHilite = NO; … … 221 222 } 222 223 224 -(float)minimumShelfWidth 225 { 226 // The shelf can never be completely closed. We always have at least enough to show our resize thumb, otherwise 227 // if the delegate responds to shelfSplitView:validateWidth:, we use that width as our minimum shelf size 228 float minShelf = THUMB_WIDTH; 229 if( delegateHasValidateWidth ){ 230 float requestedWidth = [delegate shelfSplitView:self validateWidth: 0]; 231 if( requestedWidth > minShelf ){ 232 minShelf = requestedWidth; 233 } 234 } 235 236 return minShelf; 237 } 238 223 239 -(void)setShelfWidth:(float)aWidth{ 224 float newWidth = aWidth; 225 226 240 float newWidth = aWidth; 241 227 242 // The shelf can never be completely closed. We always have at least enough to show our resize thumb, otherwise 228 243 // if the delegate responds to shelfSplitView:validateWidth:, we use that width as our minimum shelf size … … 234 249 } 235 250 } 251 236 252 if( minShelf > newWidth ){ 237 253 newWidth = minShelf; … … 412 428 if( activeControlPart != CONTROL_PART_NONE ){ 413 429 if([anEvent clickCount] == 2){ 414 [self setShelfIsVisible: NO]; 430 if( (activeControlPart == CONTROL_PART_RESIZE_THUMB) || (activeControlPart == CONTROL_PART_RESIZE_BAR) ){ 431 float minShelfWidth = [self minimumShelfWidth]; 432 if (currentShelfWidth > minShelfWidth) { 433 prevShelfWidthBeforeDoubleClick = currentShelfWidth; 434 [self setShelfWidth:minShelfWidth]; 435 } else { 436 [self setShelfWidth:prevShelfWidthBeforeDoubleClick]; 437 } 438 } 439 415 440 } else { 416 441 while( stillMouseDown ){