On Thu, 2004-02-05 at 08:00, Quentin Math� wrote:
> Hi all,
> 
> Here is a patch for NSButtonCell.m which permits to the class to be 
> drawn transparent when it is not bordered.
> 
> I also removed few lines about the focus dotted rect in order to have 
> it always drawn with the same size than the button. It looks 
> inconsistent to me to have the dotted rect not drawn with the same size 
> when the button has a title, IMHO it should indicate the last focused 
> area which in this case is not just the title area, but like always the 
> button area. And I think also the focus dotted rect must be drawn even 
> when the button is not bezeled (nor bordered).
> What do you think ?
> 

Looks reasonable to me. Any other comments on this?
*** /home/qmathe/myCVS/gnustep/core/gui/Source/NSButtonCell.m	Thu Feb  5 13:07:38 2004
--- NSButtonCell.m	Thu Feb  5 15:22:07 2004
***************
*** 669,683 ****
        cellFrame = NSOffsetRect(cellFrame, 1., flippedView ? 1. : -1.);
      }
  
-   /* Determine the background color. */
-   if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask))
-     {
-       backgroundColor = [NSColor selectedControlColor];
-     }
- 
-   if (backgroundColor == nil)
-     backgroundColor = [NSColor controlBackgroundColor];
- 
    /* Draw the cell's background color.  
       We draw when there is a border or when highlightsByMask
       is NSChangeBackgroundCellMask or NSChangeGrayCellMask,
--- 669,674 ----
***************
*** 686,693 ****
        || (_highlightsByMask & NSChangeBackgroundCellMask)
        || (_highlightsByMask & NSChangeGrayCellMask))
      {
!       [backgroundColor set];
!       NSRectFill (cellFrame);
      }
  
    /*
--- 677,713 ----
        || (_highlightsByMask & NSChangeBackgroundCellMask)
        || (_highlightsByMask & NSChangeGrayCellMask))
      {
!       /* Determine the background color. */
!       if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask))
!         {
!           backgroundColor = [NSColor selectedControlColor];
!         }
!       else if (_cell.is_bordered) 
!         {
!           backgroundColor = [NSColor controlBackgroundColor];
!         }
!       else 
!         {
!           NSView *opaqueAncestor;
! 	
!           /* 
! 	   * we cannot use backgroundColor = [NSColor clearColor] because
! 	   * there is no alpha support at the code writing time
! 	   */
! 	
! 	  // we must call superview because opaqueAncestor can return the caller
! 	  opaqueAncestor = [[_control_view superview] opaqueAncestor]; 
!           [opaqueAncestor lockFocus]; 
!           [opaqueAncestor drawRect:[_control_view frame]];
!           [opaqueAncestor unlockFocus];
!         }
!       
!       if (backgroundColor != nil) 
!         {
!           [backgroundColor set];
!           NSRectFill (cellFrame);
!         }
!       
      }
  
    /*
***************
*** 882,893 ****
    if (_cell.shows_first_responder
        && [[controlView window] firstResponder] == controlView)
      {
-       if (_cell.is_bordered || _cell.is_bezeled)
- 	NSDottedFrameRect(cellFrame);
-       else if (ipos == NSImageOnly)
  	NSDottedFrameRect(cellFrame);
-       else
- 	NSDottedFrameRect(titleRect);
      }
  }
  
--- 902,908 ----
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to