Changeset 823


Ignore:
Timestamp:
Aug 22, 2006, 7:50:45 PM (15 years ago)
Author:
livings124
Message:

Log window now indents none-first lines.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r822 r823  
    4040        fTimer = [NSTimer scheduledTimerWithTimeInterval: UPDATE_SECONDS target: self
    4141                    selector: @selector(updateLog:) userInfo: nil repeats: YES];
    42         fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont fontWithName: @"Monaco" size: 10],
    43                                                                         NSFontAttributeName, nil];
     42       
     43        NSMutableParagraphStyle * paragraph = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
     44        [paragraph setHeadIndent: 20.0];
     45       
     46        fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
     47                        [NSFont fontWithName: @"Monaco" size: 10], NSFontAttributeName,
     48                        paragraph, NSParagraphStyleAttributeName, nil];
    4449       
    4550        [[self window] update]; //make sure nib is loaded right away
     
    8691    BOOL shouldScroll = [scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0;
    8792   
    88     NSAttributedString * messageString;
    89     NSString * levelString;
    90     NSCalendarDate * dateString;
     93    NSMutableAttributedString * messageString;
     94    NSString * levelString, * dateString;
    9195    for (currentMessage = messages; currentMessage != NULL; currentMessage = currentMessage->next)
    9296    {
     
    107111       
    108112        dateString = [[NSDate dateWithTimeIntervalSince1970: currentMessage->when]
    109                             dateWithCalendarFormat: @"%1m/%d %H:%M:%S" timeZone: nil];
    110         messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s",
     113                            descriptionWithCalendarFormat: @"%1m/%d %H:%M:%S" timeZone: nil locale: nil];
     114        messageString = [[[NSMutableAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s",
    111115                            dateString, levelString, currentMessage->message] attributes: fAttributes] autorelease];
    112116       
Note: See TracChangeset for help on using the changeset viewer.