The condition does not work, as MAC_OS_X_VERSION_10_5 is not defined  
on Tiger.

Christiaan

On 28 Nov 2007, at 7:05 PM, [EMAIL PROTECTED] wrote:

> Revision: 11731
>           http://bibdesk.svn.sourceforge.net/bibdesk/? 
> rev=11731&view=rev
> Author:   amaxwell
> Date:     2007-11-28 10:05:09 -0800 (Wed, 28 Nov 2007)
>
> Log Message:
> -----------
> check level indicator style
>
> Modified Paths:
> --------------
>     branches/TRY_ARM_FILE_INTERFACE/bibdesk/BDSKLevelIndicatorCell.m
>
> Modified: branches/TRY_ARM_FILE_INTERFACE/bibdesk/ 
> BDSKLevelIndicatorCell.m
> ===================================================================
> --- branches/TRY_ARM_FILE_INTERFACE/bibdesk/ 
> BDSKLevelIndicatorCell.m      2007-11-28 16:52:32 UTC (rev 11730)
> +++ branches/TRY_ARM_FILE_INTERFACE/bibdesk/ 
> BDSKLevelIndicatorCell.m      2007-11-28 18:05:09 UTC (rev 11731)
> @@ -45,6 +45,15 @@
>  - (void)_drawRelevancyWithFrame:(NSRect)cellFrame inView:(NSView *) 
> controlView;
>  @end
>
> +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
> +typedef NSInteger NSBackgroundStyle;
> [EMAIL PROTECTED] NSLevelIndicatorStyle (LeopardOnly)
> +- (NSBackgroundStyle)backgroundStyle;
> [EMAIL PROTECTED]
> +#else
> +#warning remove this
> +#endif
> +
>  @implementation BDSKLevelIndicatorCell
>
>  - (id)initWithLevelIndicatorStyle:(NSLevelIndicatorStyle) 
> levelIndicatorStyle;
> @@ -72,7 +81,7 @@
>  #define WIDTH 2
>  #define HEIGHT 10
>
> -- (CGLayerRef)deselectedRelevancyLayer
> +- (CGLayerRef)darkRelevancyLayer
>  {
>      static CGLayerRef layer = NULL;
>      if (NULL == layer) {
> @@ -92,7 +101,7 @@
>      return layer;
>  }
>
> -- (CGLayerRef)selectedRelevancyLayer
> +- (CGLayerRef)lightRelevancyLayer
>  {
>      static CGLayerRef layer = NULL;
>      if (NULL == layer) {
> @@ -131,14 +140,28 @@
>  - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
>  {
>      NSRect r = BDSKCenterRectVertically(cellFrame, [self  
> indicatorHeight], [controlView isFlipped]);
> +    r = [controlView centerScanRect:r];
> +
>      unsigned i, iMax = floor([self doubleValue] / [self maxValue]  
> * (NSWidth(r) / 2));
>      CGLayerRef toDraw;
>
> -    // @@ fixme; better way to do this on 10.5; check - 
> backgroundStyle
> -    if ([self isHighlighted])
> -        toDraw = [self selectedRelevancyLayer];
> -    else
> -        toDraw = [self deselectedRelevancyLayer];
> +    if ([self respondsToSelector:@selector(backgroundStyle)]) {
> +        NSBackgroundStyle style = [self backgroundStyle];
> +        if (NSBackgroundStyleLight == style)
> +            toDraw = [self darkRelevancyLayer];
> +        else
> +            toDraw = [self lightRelevancyLayer];
> +    } else {
> +        if ([self isHighlighted]) {
> +            // this is what NSCell does prior to 10.5, but it  
> doesn't work with gradient tableviews
> +            if ([[self highlightColorWithFrame:cellFrame  
> inView:controlView] isEqual:[NSColor alternateSelectedControlColor]])
> +                toDraw = [self lightRelevancyLayer];
> +            else
> +                toDraw = [self darkRelevancyLayer];
> +        } else {
> +            toDraw = [self darkRelevancyLayer];
> +        }
> +    }
>
>      CGContextRef ctxt = [[NSGraphicsContext currentContext]  
> graphicsPort];
>      CGContextSaveGState(ctxt);
>
>
> This was sent by the SourceForge.net collaborative development  
> platform, the world's largest Open Source development site.
>
> ---------------------------------------------------------------------- 
> ---
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Bibdesk-commit mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to