Author: fredkiefer
Date: Wed Apr  2 22:55:19 2014
New Revision: 37782

URL: http://svn.gna.org/viewcvs/gnustep?rev=37782&view=rev
Log:
2013-04-02  Frank Le Grand <[email protected]>

        * 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.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/GSToolbarCustomizationPalette.m
    libs/gui/trunk/Source/NSToolbarItem.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=37782&r1=37781&r2=37782&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Wed Apr  2 22:55:19 2014
@@ -1,3 +1,10 @@
+2013-04-02  Frank Le Grand <[email protected]>
+
+       * 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 <[email protected]>
 
        * Headers/Additions/GNUstepGUI/GSXibObjectContainer.h

Modified: libs/gui/trunk/Source/GSToolbarCustomizationPalette.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSToolbarCustomizationPalette.m?rev=37782&r1=37781&r2=37782&view=diff
==============================================================================
--- libs/gui/trunk/Source/GSToolbarCustomizationPalette.m       (original)
+++ libs/gui/trunk/Source/GSToolbarCustomizationPalette.m       Wed Apr  2 
22:55:19 2014
@@ -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]; 
     }
 

Modified: libs/gui/trunk/Source/NSToolbarItem.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSToolbarItem.m?rev=37782&r1=37781&r2=37782&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSToolbarItem.m       (original)
+++ libs/gui/trunk/Source/NSToolbarItem.m       Wed Apr  2 22:55:19 2014
@@ -1331,7 +1331,13 @@
   [_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 @@
 
 - (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];
 }
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to