Adium

Changeset 23985

Show
Ignore:
Timestamp:
06/14/2008 09:23:52 PM (6 months ago)
Author:
zacw
Message:

Add a HiddenPreferences to hide group counts when collapsed. Use defaults write com.adiumx.adiumx AIHideCollapsedGroupCount -bool YES to hide the count, and defaults write com.adiumx.adiumx AIHideCollapsedGroupCount -bool NO to disable hiding it. Fixes #9986. Closes #9763.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/Adium Framework/Source/AIAbstractListController.m

    r23983 r23985  
    408408        } 
    409409         
     410        //Collapsed group counting 
     411        //The preference is to hide (so that by default it's NO), so invert it 
     412        [groupCell setShowCollapsedCount:![[[NSUserDefaults standardUserDefaults] objectForKey:@"AIHideCollapsedGroupCount"] boolValue]]; 
     413         
    410414        //Fonts 
    411415        NSFont  *theFont; 
  • trunk/Frameworks/Adium Framework/Source/AIListGroupCell.h

    r23671 r23985  
    2525        BOOL            drawsBackground; 
    2626        BOOL            drawsGradientEdges; 
     27        BOOL            showCollapsedCount; 
    2728        NSLayoutManager *layoutManager; 
    2829         
     
    3233 
    3334- (int)flippyIndent; 
     35- (void)setShowCollapsedCount:(BOOL)inValue; 
    3436- (void)setShadowColor:(NSColor *)inColor; 
    3537- (NSColor *)shadowColor; 
  • trunk/Frameworks/Adium Framework/Source/AIListGroupCell.m

    r23710 r23985  
    112112} 
    113113 
     114- (void)setShowCollapsedCount:(BOOL)inValue 
     115{ 
     116        showCollapsedCount = inValue; 
     117} 
     118 
    114119 
    115120 
     
    146151        [displayName release]; 
    147152         
    148         if (([[listObject displayArrayObjectForKey:@"Show Count"] boolValue] || ![controlView isItemExpanded:listObject]) &&  
    149                 [listObject displayArrayObjectForKey:@"Count Text"]) { 
     153        if ((([[listObject displayArrayObjectForKey:@"Show Count"] boolValue]) || 
     154                ((showCollapsedCount) && 
     155                  (![controlView isItemExpanded:listObject]))) &&  
     156                ([listObject displayArrayObjectForKey:@"Count Text"])) { 
    150157                NSAttributedString *countText = [[NSAttributedString alloc] initWithString:[listObject displayArrayObjectForKey:@"Count Text"] attributes:[self labelAttributes]]; 
    151158                width += ceil([countText size].width) + 1; 
     
    198205//      } 
    199206         
    200         if ([[listObject displayArrayObjectForKey:@"Show Count"] boolValue] || ![controlView isItemExpanded:listObject]) { 
     207        if (([[listObject displayArrayObjectForKey:@"Show Count"] boolValue]) || 
     208                 ((showCollapsedCount) && 
     209                  (![controlView isItemExpanded:listObject]))) { 
    201210                rect = [self drawGroupCountWithFrame:rect]; 
    202211        }