From 9f478f8a62450b365ca01cc2d35f24907d75ad69 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Mon, 3 May 1999 17:31:11 +0000 Subject: [PATCH] Fix suggested by Benhur git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4191 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSButtonCell.m | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e4b4a451c..eb48afe78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon May 3 18:55:00 1999 Richard Frith-Macdonald + + * Source/NSButtonCell.m: ([-drawWithFrame:inView:]) and + ([-drawInteriorWithFrame:inView:]) respect ([-isTransparent]) + 1999-05-01 Adam Fedor * Headers/gnustep/gui/NSGraphicsContext.h diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 521f54ba0..e60a1b58c 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -386,6 +386,10 @@ // Save last view drawn to [self setControlView: controlView]; + // transparent buttons never draw + if ([self isTransparent]) + return; + // do nothing if cell's frame rect is zero if (NSIsEmptyRect(cellFrame)) return; @@ -414,7 +418,11 @@ NSString *titleToDisplay; NSSize imageSize = {0, 0}; NSRect rect; - NSColor *backgroundColor = [NSColor controlBackgroundColor]; + NSColor *backgroundColor = nil; + + // transparent buttons never draw + if ([self isTransparent]) + return; cellFrame = NSInsetRect(cellFrame, xDist, yDist); @@ -433,6 +441,9 @@ backgroundColor = [NSColor selectedControlColor]; } + if (backgroundColor == nil) + backgroundColor = [NSColor controlBackgroundColor]; + // set cell's background color [backgroundColor set]; NSRectFill(cellFrame);