From 57ea7f8bf1bc2fa7c0a683e7cf54fdf336093e33 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Tue, 25 Dec 2001 14:07:25 +0000 Subject: [PATCH] Fixed drawing of background color which had broken nextstep-like look&feel git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11898 72102866-910b-0410-8b05-ffd578937521 --- Source/NSButtonCell.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index ada0cbe65..bd5922d1e 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -614,14 +614,13 @@ else mask = NSNoCellMask; - // pushed in buttons contents are displaced to the bottom right 1px + /* Pushed in buttons contents are displaced to the bottom right 1px. */ if (_cell.is_bordered && (mask & NSPushInCellMask)) { cellFrame = NSOffsetRect(cellFrame, 1., flippedView ? 1. : -1.); } - /* - // determine the background color + /* Determine the background color. */ if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask)) { backgroundColor = [NSColor selectedControlColor]; @@ -630,10 +629,10 @@ if (backgroundColor == nil) backgroundColor = [NSColor controlBackgroundColor]; - // set cell's background color + /* Draw the cell's background color. We always draw the background, + as required by our nextstep-like look and feel. */ [backgroundColor set]; - NSRectFill(cellFrame); - */ + NSRectFill (cellFrame); /* * Determine the image and the title that will be @@ -659,6 +658,11 @@ if (imageToDisplay) { + /* FIXME - the following is a hack! Because we don't seem to be + getting alpha composing of images right, we use this hack of + hard-setting manually the background color of the image to + the wanted background color ... this should go away when + alpha composing of images works 100%. */ [imageToDisplay setBackgroundColor: backgroundColor]; imageSize = [imageToDisplay size]; }