Changeset 5260


Ignore:
Timestamp:
Mar 16, 2008, 2:24:27 PM (14 years ago)
Author:
livings124
Message:

#792 Allow Option-Command-F to focus the filter field in the main window

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r5148 r5260  
    242242- (void) toggleFilterBar: (id) sender;
    243243- (void) showFilterBar: (BOOL) show animate: (BOOL) animate;
     244- (void) focusFilterField;
    244245
    245246- (void) allToolbarClicked: (id) sender;
  • trunk/macosx/Controller.m

    r5253 r5260  
    27972797}
    27982798
    2799 - (void) toggleStatusBar: (id) sender
    2800 {
    2801     [self showStatusBar: [fStatusBar isHidden] animate: YES];
    2802     [fDefaults setBool: ![fStatusBar isHidden] forKey: @"StatusBar"];
    2803 }
    2804 
    28052799- (NSRect) windowFrameByAddingHeight: (float) height checkLimits: (BOOL) check
    28062800{
     
    28382832}
    28392833
     2834- (void) toggleStatusBar: (id) sender
     2835{
     2836    [self showStatusBar: [fStatusBar isHidden] animate: YES];
     2837    [fDefaults setBool: ![fStatusBar isHidden] forKey: @"StatusBar"];
     2838}
     2839
     2840//doesn't save shown state
    28402841- (void) showStatusBar: (BOOL) show animate: (BOOL) animate
    28412842{
     
    29082909}
    29092910
     2911//doesn't save shown state
    29102912- (void) showFilterBar: (BOOL) show animate: (BOOL) animate
    29112913{
     
    29602962        [fWindow makeFirstResponder: fTableView];
    29612963    }
     2964}
     2965
     2966- (void) focusFilterField
     2967{
     2968    [fWindow makeFirstResponder: fSearchFilterField];
     2969    if ([fFilterBar isHidden])
     2970        [self toggleFilterBar: self];
    29622971}
    29632972
  • trunk/macosx/TorrentTableView.m

    r5239 r5260  
    508508}
    509509
     510//option-command-f will focus the filter bar's search field
     511- (void) keyDown: (NSEvent *) event
     512{
     513    if ([[event charactersIgnoringModifiers] isEqualToString: @"f"] && [event modifierFlags] & NSAlternateKeyMask
     514        && [event modifierFlags] & NSCommandKeyMask)
     515        [fController focusFilterField];
     516    else
     517        [super keyDown: event];
     518}
     519
    510520- (void) toggleControlForTorrent: (Torrent *) torrent
    511521{
Note: See TracChangeset for help on using the changeset viewer.