Ignore:
Timestamp:
03/16/03 17:19:40 (22 years ago)
Author:
Nicholas Riley
Message:

OACalendarView.m: Highlight with secondary (unfocused) highlight color
when view is not focused. Override -needsPanelToBecomeKey so keyboard
shortcuts work even if full keyboard navigation disabled. Fixes bug
28.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/OACalendarView.m

    r102 r125  
    202202//
    203203
     204- (BOOL)needsPanelToBecomeKey;
     205{
     206    return YES;
     207}
     208
    204209- (BOOL)isFlipped;
    205210{
     
    242247    [[NSColor gridColor] set];
    243248    NSFrameRect(gridHeaderAndBodyRect);
     249
    244250}
    245251
     
    638644    int index, row, column;
    639645    NSSize cellSize;
     646    BOOL isFirstResponder = ([[self window] firstResponder] == self);
    640647
    641648    // the cell is actually one pixel shorter than the row height, because the row height includes the bottom grid line (or the top grid line, depending on which way you prefer to think of it)
     
    688695               
    689696                if (shouldHighlightThisDay) {
    690                     [[NSColor selectedControlColor] set];
     697                    [(isFirstResponder ? [NSColor selectedControlColor] : [NSColor secondarySelectedControlColor]) set];
    691698                    NSRectFill(cellFrame);
    692699                }
Note: See TracChangeset for help on using the changeset viewer.