Changeset 3248
- Timestamp:
- 06/04/06 17:36:57 (2 years ago)
- Files:
-
- trunk/Controllers/JVSidebarChatWindowController.m (modified) (2 diffs)
- trunk/Resources/JVSidebarChatWindow.nib/info.nib (modified) (1 diff)
- trunk/Resources/JVSidebarChatWindow.nib/keyedobjects.nib (modified) (previous)
- trunk/Resources/info.colloquy.plist (modified) (1 diff)
- trunk/Views/JVSideSplitView.m (modified) (2 diffs)
- trunk/Views/JVSplitView.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Controllers/JVSidebarChatWindowController.m
r3219 r3248 32 32 } 33 33 34 - (float) splitView:(NSSplitView *) splitView constrainSplitPosition:(float) proposedPosition ofSubviewAt:(int) index { 35 // don't do anything here 36 return proposedPosition; 37 } 38 39 - (void) splitViewWillResizeSubviews:(NSNotification *) notification { 40 // don't do anything here 41 } 42 34 43 - (void) splitViewDidResizeSubviews:(NSNotification *) notification { 35 44 if( ! _forceSplitViewPosition ) … … 38 47 } 39 48 40 - (float) splitView:(NSSplitView *) s enderconstrainMinCoordinate:(float) proposedMin ofSubviewAt:(int) offset {41 if( ! [[[chatViewsOutlineView enclosingScrollView] verticalScroller] isHidden] )42 return 55. + NSWidth( [[[chatViewsOutlineView enclosingScrollView] verticalScroller] frame] );43 return 55.;49 - (float) splitView:(NSSplitView *) splitView constrainMinCoordinate:(float) proposedMin ofSubviewAt:(int) offset { 50 // if( ! [[[chatViewsOutlineView enclosingScrollView] verticalScroller] isHidden] ) 51 // return 55. + NSWidth( [[[chatViewsOutlineView enclosingScrollView] verticalScroller] frame] ); 52 return 100.; 44 53 } 45 54 46 - (float) splitView:(NSSplitView *) s enderconstrainMaxCoordinate:(float) proposedMax ofSubviewAt:(int) offset {55 - (float) splitView:(NSSplitView *) splitView constrainMaxCoordinate:(float) proposedMax ofSubviewAt:(int) offset { 47 56 return 300.; 57 } 58 59 - (BOOL) splitView:(NSSplitView *) splitView canCollapseSubview:(NSView *) subview { 60 return NO; 48 61 } 49 62 trunk/Resources/JVSidebarChatWindow.nib/info.nib
r3206 r3248 6 6 <string>576 58 365 309 0 0 1440 878 </string> 7 7 <key>IBFramework Version</key> 8 <string>44 3.0</string>8 <string>446.1</string> 9 9 <key>IBLockedObjects</key> 10 10 <array> trunk/Resources/info.colloquy.plist
r3231 r3248 3 3 <plist version="0.9"> 4 4 <dict> 5 <key>JV SidebarSplitViewPosition</key>6 < string>{{0, 0}, {173, 378}};{{174, 0}, {437, 378}}</string>5 <key>JVChatWindowInterface</key> 6 <integer>2</integer> 7 7 <key>JVChatTranscriptFolder</key> 8 8 <string>~/Documents/Colloquy Transcripts</string> trunk/Views/JVSideSplitView.m
r3219 r3248 2 2 3 3 @implementation JVSideSplitView 4 - (id) initWithCoder:(NSCoder *) decoder { 5 if( ( self = [super initWithCoder:decoder] ) ) 6 _mainSubviewIndex = 1; 7 return self; 8 } 9 4 10 - (float) dividerThickness { 5 11 return 1.0; … … 14 20 NSRectFill( rect ); 15 21 } 22 23 - (void) resizeSubviewsWithOldSize:(NSSize) oldSize { 24 [self adjustSubviews]; 25 } 26 27 - (void) adjustSubviews { 28 if( _mainSubviewIndex == -1 || [[self subviews] count] != 2 ) { 29 [super adjustSubviews]; 30 return; 31 } 32 33 float dividerThickness = [self dividerThickness]; 34 NSRect newFrame = [self frame]; 35 36 NSView *mainView = [[self subviews] objectAtIndex:_mainSubviewIndex]; 37 NSView *otherView = ( _mainSubviewIndex ? [[self subviews] objectAtIndex:0] : [[self subviews] objectAtIndex:1] ); 38 39 NSRect mainFrame = [mainView frame]; 40 NSRect otherFrame = [otherView frame]; 41 42 if( [self isVertical] ) { 43 mainFrame.size.width = NSWidth( newFrame ) - dividerThickness - NSWidth( otherFrame ); 44 mainFrame.size.height = NSHeight( newFrame ); 45 mainFrame.origin.x = ( _mainSubviewIndex ? NSWidth( otherFrame ) + dividerThickness : 0. ); 46 mainFrame.origin.y = 0.; 47 } else { 48 mainFrame.size.width = NSWidth( newFrame ); 49 mainFrame.size.height = NSHeight( newFrame ) - dividerThickness - NSHeight( otherFrame ); 50 mainFrame.origin.x = 0.; 51 mainFrame.origin.y = ( _mainSubviewIndex ? NSHeight( otherFrame ) + dividerThickness : 0. ); 52 } 53 54 if( [self isVertical] ) { 55 otherFrame.size.width = NSWidth( otherFrame ); 56 otherFrame.size.height = NSHeight( newFrame ); 57 otherFrame.origin.x = ( _mainSubviewIndex ? 0. : NSWidth( mainFrame ) + dividerThickness ); 58 otherFrame.origin.y = 0.; 59 } else { 60 otherFrame.size.width = NSWidth( newFrame ); 61 otherFrame.size.height = NSHeight( otherFrame ); 62 otherFrame.origin.x = 0.; 63 otherFrame.origin.y = ( _mainSubviewIndex ? 0. : NSWidth( mainFrame ) + dividerThickness ); 64 } 65 66 [mainView setFrame:mainFrame]; 67 [otherView setFrame:otherFrame]; 68 69 [self setNeedsDisplay:YES]; 70 } 16 71 @end trunk/Views/JVSplitView.m
r3219 r3248 83 83 } else [super drawDividerInRect:rect]; 84 84 } 85 86 #pragma mark -87 88 - (void) adjustSubviews {89 if( _mainSubviewIndex == -1 || [[self subviews] count] != 2 ) {90 [super adjustSubviews];91 return;92 }93 94 float dividerThickness = [self dividerThickness];95 NSRect newFrame = [self frame];96 97 NSView *mainView = [[self subviews] objectAtIndex:_mainSubviewIndex];98 NSView *otherView = ( _mainSubviewIndex ? [[self subviews] objectAtIndex:0] : [[self subviews] objectAtIndex:1] );99 100 NSRect mainFrame = [mainView frame];101 NSRect otherFrame = [otherView frame];102 103 if( [self isVertical] ) {104 mainFrame.size.width = NSWidth( newFrame ) - dividerThickness - NSWidth( otherFrame );105 mainFrame.size.height = NSHeight( newFrame );106 mainFrame.origin.x = ( _mainSubviewIndex ? NSWidth( otherFrame ) + dividerThickness : 0. );107 mainFrame.origin.y = 0.;108 } else {109 mainFrame.size.width = NSWidth( newFrame );110 mainFrame.size.height = NSHeight( newFrame ) - dividerThickness - NSHeight( otherFrame );111 mainFrame.origin.x = 0.;112 mainFrame.origin.y = ( _mainSubviewIndex ? NSHeight( otherFrame ) + dividerThickness : 0. );113 }114 115 if( [self isVertical] ) {116 otherFrame.size.width = NSWidth( otherFrame );117 otherFrame.size.height = NSHeight( newFrame );118 otherFrame.origin.x = ( _mainSubviewIndex ? 0. : NSWidth( mainFrame ) + dividerThickness );119 otherFrame.origin.y = 0.;120 } else {121 otherFrame.size.width = NSWidth( newFrame );122 otherFrame.size.height = NSHeight( otherFrame );123 otherFrame.origin.x = 0.;124 otherFrame.origin.y = ( _mainSubviewIndex ? 0. : NSWidth( mainFrame ) + dividerThickness );125 }126 127 [mainView setFrame:mainFrame];128 [otherView setFrame:otherFrame];129 130 NSLog( @"%f %@ %@", dividerThickness, NSStringFromRect( otherFrame ), NSStringFromRect( mainFrame ) );131 132 if( ! ( [self inLiveResize] && [self preservesContentDuringLiveResize] ) )133 [self setNeedsDisplay:YES];134 }135 85 @end
