~ubuntu-branches/ubuntu/natty/transmission/natty

« back to all changes in this revision

Viewing changes to macosx/StatusBarView.m

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-12-08 10:49:11 UTC
  • mfrom: (1.1.29 upstream) (2.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20091208104911-06gio45n2nla3vpg
Tags: 1.80~b1-0ubuntu1
* New upstream release (LP: #460620), rebased on debian unstable
  remaining changes:
  - debian/control:
    + Added replaces & provides clutch (now included as part of transmission).
      Can be removed in lucid+1
    + Added quilt, liblaunchpad-integration-dev and lsb-release to Build-Depends
  - debian/rules:
    + create a po template during package build.
  - debian/patches/01_lpi.patch:
    + integrate transmission with launchpad
  - debian/patches/20_add_x-ubuntu-gettext-domain.diff:
    + add x-ubuntu-gettext-domain to .desktop file.
  - debian/transmission-daemon.default:
    - remove --auth from OPTIONS
* Fixes bugs:
  - tray menu shows wrong status for "main window" when started minimized
    (LP: #451415)
* Refreshed patches:
  - dont_build_libevent.patch
  - 99_autoreconf.patch
* Removed patches:
  - 21_onPortTested.diff, 23_tr_torrentNext.diff and
    24_tr_torrentDeleteLocalData_do_move.diff
* debian/patches/21_fix_inhibition.patch:
  - The right value for suspend inhibition is 4
* debian/control:
  - Build-Depend on libgconf2-dev to enable magnet link registration and on
    libcanberra-gtk-dev for notification sound.
* debian/watch:
  - make it detect beta versions, to be removed after 1.80 is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: StatusBarView.m 7659 2009-01-10 23:37:37Z livings124 $
 
2
 * $Id: StatusBarView.m 9520 2009-11-14 03:17:07Z livings124 $
3
3
 * 
4
4
 * Copyright (c) 2006-2009 Transmission authors and contributors
5
5
 *
30
30
{
31
31
    if ((self = [super initWithFrame: rect]))
32
32
    {
33
 
        fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0f/255.0f green: 171.0f/255.0f blue: 171.0f/255.0f alpha: 1.0f] retain];
 
33
        fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0/255.0 green: 171.0/255.0 blue: 171.0/255.0 alpha: 1.0] retain];
34
34
    }
35
35
    return self;
36
36
}
43
43
 
44
44
- (void) drawRect: (NSRect) rect
45
45
{
46
 
    NSRect lineBorderRect = NSMakeRect(rect.origin.x, [self bounds].size.height - 1.0f, rect.size.width, 1.0f);
47
 
    if (NSIntersectsRect(lineBorderRect, rect))
48
 
    {
49
 
        [[NSColor whiteColor] set];
50
 
        NSRectFill(lineBorderRect);
51
 
        
52
 
        rect.size.height--;
53
 
    }
54
 
    
55
 
    lineBorderRect.origin.y = 0.0f;
56
 
    if (NSIntersectsRect(lineBorderRect, rect))
57
 
    {
58
 
        [fGrayBorderColor set];
59
 
        NSRectFill(lineBorderRect);
60
 
        
61
 
        rect.origin.y++;
62
 
        rect.size.height--;
63
 
    }
64
 
    
65
 
    [[NSColor controlColor] set];
66
 
    NSRectFill(rect);
 
46
    NSInteger count = 0;
 
47
    NSRect gridRects[3];
 
48
    NSColor * colorRects[3];
 
49
    
 
50
    NSRect lineBorderRect = NSMakeRect(NSMinX(rect), NSHeight([self bounds]) - 1.0, NSWidth(rect), 1.0);
 
51
    if (NSIntersectsRect(lineBorderRect, rect))
 
52
    {
 
53
        gridRects[count] = lineBorderRect;
 
54
        colorRects[count] = [NSColor whiteColor];
 
55
        ++count;
 
56
        
 
57
        rect.size.height -= 1.0;
 
58
    }
 
59
    
 
60
    lineBorderRect.origin.y = 0.0;
 
61
    if (NSIntersectsRect(lineBorderRect, rect))
 
62
    {
 
63
        gridRects[count] = lineBorderRect;
 
64
        colorRects[count] = fGrayBorderColor;
 
65
        ++count;
 
66
        
 
67
        rect.origin.y += 1.0;
 
68
        rect.size.height -= 1.0;
 
69
    }
 
70
    
 
71
    gridRects[count] = rect;
 
72
    colorRects[count] = [NSColor controlColor];
 
73
    ++count;
 
74
    
 
75
    NSRectFillListWithColors(gridRects, colorRects, count);
67
76
}
68
77
 
69
78
@end