diff --git a/ChangeLog b/ChangeLog index d385f05d2..61ef25507 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-20 Nicola Pero + + * Source/NSButtonCell.m ([-cellSize]): Restored horizontal space + around text in autosized bezeled/bordered buttons not containing + only an image so that the autosizing is correct again. + 2008-03-19 Adam Fedor * Version 0.13.2 diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index f24df57bc..c740e5ca1 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -1390,6 +1390,21 @@ typedef struct _GSButtonCellFlags else borderSize = NSZeroSize; + /* Add an additional 6 pixels horizontally so that the text is not + * too near the boundaries of the button. Without them, autosized + * buttons look too tiny and crammed. This might be made + * configurable by the theme, but most likely only because themes + * might want to have even more space here (to make buttons more + * clear and readable) rather than less! Eg. Apple by default has + * huge amounts of empty space between the text and the borders of + * their push buttons. + */ + if ((_cell.is_bordered && (_cell.image_position != NSImageOnly)) + || _cell.is_bezeled) + { + borderSize.width += 6; + } + // Add border size s.width += 2 * borderSize.width; s.height += 2 * borderSize.height;