Changeset 313


Ignore:
Timestamp:
Jun 10, 2006, 3:21:36 AM (16 years ago)
Author:
livings124
Message:

Make context menu items enabled even if the window isn't active.

Also fixed a little spacing with the buttons.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r310 r313  
    11411141    SEL action = [menuItem action];
    11421142
    1143     //only enable some menus if window is useable
     1143    //only enable some items if the window is useable or it is in a context menu
    11441144    BOOL canUseWindow = [fWindow isKeyWindow] && ![fToolbar customizationPaletteIsRunning];
     1145    BOOL fromContext = [[[menuItem menu] title] isEqualToString: @"Context"];
    11451146
    11461147    //enable show info
     
    11911192    if (action == @selector(revealFile:))
    11921193    {
    1193         return canUseWindow && [fTableView numberOfSelectedRows] > 0;
     1194        return (canUseWindow || fromContext) && [fTableView numberOfSelectedRows] > 0;
    11941195    }
    11951196
     
    12251226                            [title rangeOfString: NS_ELLIPSIS].location]];
    12261227        }
    1227         return canUseWindow && [fTableView numberOfSelectedRows] > 0;
     1228        return (canUseWindow || fromContext) && [fTableView numberOfSelectedRows] > 0;
    12281229    }
    12291230
     
    12311232    if( action == @selector(stopTorrent:) )
    12321233    {
    1233         if (!canUseWindow)
     1234        if (!canUseWindow && !fromContext)
    12341235            return NO;
    12351236   
     
    12501251    if( action == @selector(resumeTorrent:) )
    12511252    {
    1252         if (!canUseWindow)
     1253        if (!canUseWindow && !fromContext)
    12531254            return NO;
    12541255   
  • trunk/macosx/TorrentTableView.m

    r284 r313  
    2929
    3030#define BUTTON_WIDTH 14.0
    31 #define BUTTON_TO_TOP 32.5
    32 #define AREA_CENTER 23.0
     31#define BUTTON_TO_TOP 33.5
     32#define AREA_CENTER 21.0
    3333#define DISTANCE_FROM_CENTER 2.5
    3434
    3535@implementation TorrentTableView
     36
     37- (void) awakeFromNib
     38{
     39    [fContextRow setTitle: @"Context"];
     40    [fContextNoRow setTitle: @"Context"];
     41}
    3642
    3743- (void) setTorrents: (NSArray *) torrents
Note: See TracChangeset for help on using the changeset viewer.