Fixed default title wrongly set with separator/space related toolbar items and toolbar items image unwittingly released (last partial fix for bug #15112)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22424 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Quentin Mathe 2006-02-03 16:19:27 +00:00
parent 5a064c4e39
commit 24af0ec222
2 changed files with 28 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2006-02-03 Quentin Mathe <qmathe@club-internet.fr>
* Source/NSToolbarItem.m (-[GSToolbarButtonCell setImagePosition:]):
New method to override NSButtonCell behavior. It should be the last commit
needed to correct bug #15112 (reported by Wolfgang Sourdeau). Precisely it
eliminates the default title set with separator or space toolbar
items and the image release with toolbar items which include one (both
issues occurs when NSToolbarDisplayModeLabelnOnly is set).
2006-02-03 Quentin Mathe <qmathe@club-internet.fr>
* Source/NSButtonCell.m (-setImagePosition:): Fixed the title lost (reset to

View file

@ -393,6 +393,25 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
@implementation GSToolbarButtonCell
/* Overriden NSButtonCell method to handle cell type in a basic way which avoids
to lose image or empty title on new image position (when this involves a cell
type switch) and the need to reset it. That would happen in GSToolbarButton
-layout method (on toolbar display mode switch).
Note that empty title are used with space or separator toolbar items. */
- (void) setImagePosition: (NSCellImagePosition)aPosition
{
_cell.image_position = aPosition;
if (_cell.image_position == NSNoImage)
{
_cell.type = NSTextCellType;
}
else
{
_cell.type = NSImageCellType;
}
}
// Overriden NSButtonCell method
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
{