Ignore:
Timestamp:
Oct 12, 2009, 1:59:52 AM (13 years ago)
Author:
livings124
Message:

when Quick Look is visible, make the toolbar icon blue and append "Close" to the menu item

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r9302 r9303  
    33863386    {
    33873387        ButtonToolbarItem * item = [self standardToolbarButtonWithIdentifier: ident];
     3388        [[(NSButton *)[item view] cell] setShowsStateBy: NSContentsCellMask]; //blue when enabled
    33883389       
    33893390        [item setLabel: NSLocalizedString(@"Quick Look", "QuickLook toolbar item -> label")];
     
    33933394        [item setTarget: self];
    33943395        [item setAction: @selector(toggleQuickLook:)];
    3395         [item setAutovalidates: NO];
    3396         [item setEnabled: [NSApp isOnSnowLeopardOrBetter]];
    33973396       
    33983397        return item;
     
    35083507        [(NSButton *)[toolbarItem view] setState: ![fFilterBar isHidden]];
    35093508        return YES;
     3509    }
     3510   
     3511    //set quick look image
     3512    if ([ident isEqualToString: TOOLBAR_QUICKLOOK])
     3513    {
     3514        [(NSButton *)[toolbarItem view] setState: [NSApp isOnSnowLeopardOrBetter] && [QLPreviewPanelSL sharedPreviewPanelExists]
     3515                                                    && [[QLPreviewPanelSL sharedPreviewPanel] isVisible]];
     3516        return [NSApp isOnSnowLeopardOrBetter];
    35103517    }
    35113518
     
    38653872    }
    38663873   
    3867     //quick look only works on 10.6
    38683874    if (action == @selector(toggleQuickLook:))
     3875    {
     3876        const BOOL visible = [NSApp isOnSnowLeopardOrBetter] && [QLPreviewPanelSL sharedPreviewPanelExists]
     3877                                && [[QLPreviewPanelSL sharedPreviewPanel] isVisible];
     3878        //text consistent with Finder
     3879        NSString * title = !visible ? NSLocalizedString(@"Quick Look", "View menu -> Quick Look")
     3880                                    : NSLocalizedString(@"Close Quick Look", "View menu -> Quick Look");
     3881        [menuItem setTitle: title];
     3882       
    38693883        return [NSApp isOnSnowLeopardOrBetter];
     3884    }
    38703885   
    38713886    return YES;
Note: See TracChangeset for help on using the changeset viewer.