2013-04-02 Frank Le Grand <frank.legrand@testplant.com>

* Source/NSToolbarItem.m: Fixed a bug where calling setImage:
          on a toolbar item would draw the image even if the toolbar
          display mode would be set to NSToolbarDisplayModeLabelOnly
        * Source/GSToolbarCustomizationPalette.m: Turn NSLog into
          NSDebugLLog.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37782 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2014-04-02 20:55:19 +00:00
parent 69244e2d98
commit 7c8eda0462
3 changed files with 24 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2013-04-02 Frank Le Grand <frank.legrand@testplant.com>
* Source/NSToolbarItem.m: Fixed a bug where calling setImage:
on a toolbar item would draw the image even if the toolbar
display mode would be set to NSToolbarDisplayModeLabelOnly
* Source/GSToolbarCustomizationPalette.m: Turn NSLog into NSDebugLLog.
2014-03-25 04:07-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Headers/Additions/GNUstepGUI/GSXibObjectContainer.h

View file

@ -304,7 +304,7 @@
{
NSToolbarItem *item = [toolbar _toolbarItemForIdentifier: identifier
willBeInsertedIntoToolbar: NO];
NSLog(@"item %@ for ident %@", item, identifier);
NSDebugLLog(DEBUG_LEVEL, @"item %@ for ident %@", item, identifier);
[_allowedItems addObject: item];
}

View file

@ -1331,7 +1331,13 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
[_image setScalesWhenResized: YES];
//[_image setSize: NSMakeSize(32, 32)];
[(GSToolbarButton*)_backView setImage: image];
// Do not set the image on the button if we are in "LabelOnly"
// mode. If the toolbar's displayMode changes later, we'll
// put the image on the button in the layout method.
if ([[self toolbar] displayMode] != NSToolbarDisplayModeLabelOnly)
{
[(GSToolbarButton*)_backView setImage: image];
}
}
- (void) setLabel: (NSString *)label
@ -1497,6 +1503,15 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
- (void) _layout
{
// Reset to image on the backview: We may have toggled
// from one NSToolbarDisplayMode to another, and it is
// possible setImage: would have been called on the
// NSToolbarItem while we were in NSToolbarDisplayModeLabelOnly
if ([[self toolbar] displayMode] != NSToolbarDisplayModeLabelOnly)
{
[(GSToolbarButton*)_backView setImage: _image];
}
[(id)_backView layout];
}