Changeset 3248

Show
Ignore:
Timestamp:
06/04/06 17:36:57 (2 years ago)
Author:
timothy
Message:

Sidebar mode is now working! Freaking finally! It was a lame bug... Anyway, it is now the default look.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Controllers/JVSidebarChatWindowController.m

    r3219 r3248  
    3232} 
    3333 
     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 
    3443- (void) splitViewDidResizeSubviews:(NSNotification *) notification { 
    3544        if( ! _forceSplitViewPosition ) 
     
    3847} 
    3948 
    40 - (float) splitView:(NSSplitView *) sender constrainMinCoordinate:(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.; 
    4453} 
    4554 
    46 - (float) splitView:(NSSplitView *) sender constrainMaxCoordinate:(float) proposedMax ofSubviewAt:(int) offset { 
     55- (float) splitView:(NSSplitView *) splitView constrainMaxCoordinate:(float) proposedMax ofSubviewAt:(int) offset { 
    4756        return 300.; 
     57} 
     58 
     59- (BOOL) splitView:(NSSplitView *) splitView canCollapseSubview:(NSView *) subview { 
     60        return NO; 
    4861} 
    4962 
  • trunk/Resources/JVSidebarChatWindow.nib/info.nib

    r3206 r3248  
    66        <string>576 58 365 309 0 0 1440 878 </string> 
    77        <key>IBFramework Version</key> 
    8         <string>443.0</string> 
     8        <string>446.1</string> 
    99        <key>IBLockedObjects</key> 
    1010        <array> 
  • trunk/Resources/info.colloquy.plist

    r3231 r3248  
    33<plist version="0.9"> 
    44<dict> 
    5         <key>JVSidebarSplitViewPosition</key> 
    6         <string>{{0, 0}, {173, 378}};{{174, 0}, {437, 378}}</string
     5        <key>JVChatWindowInterface</key> 
     6        <integer>2</integer
    77        <key>JVChatTranscriptFolder</key> 
    88        <string>~/Documents/Colloquy Transcripts</string> 
  • trunk/Views/JVSideSplitView.m

    r3219 r3248  
    22 
    33@implementation JVSideSplitView 
     4- (id) initWithCoder:(NSCoder *) decoder { 
     5        if( ( self = [super initWithCoder:decoder] ) ) 
     6                _mainSubviewIndex = 1; 
     7        return self; 
     8} 
     9 
    410- (float) dividerThickness { 
    511        return 1.0; 
     
    1420        NSRectFill( rect ); 
    1521} 
     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} 
    1671@end 
  • trunk/Views/JVSplitView.m

    r3219 r3248  
    8383        } else [super drawDividerInRect:rect]; 
    8484} 
    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 } 
    13585@end