diff --git a/ChangeLog b/ChangeLog index cbb47d92a..6d2929b2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-03-21 09:57-EDT Gregory John Casamento + + * Panels/English.lproj/GSToolbarCustomizationPalette.gorm: Add + Default item to popup and make the connection to the show: method + to allow setting the toolbar display mode. + * Source/GSToolbarCustomizationPalette.m: Enable changing of + text, text & icon, icon only on the toolbar. + * Source/NSToolbar.m: Change _build method to load the + displayMode setting. + 2009-03-20 Richard Frith-Macdonald * Tools/gopen.m: Extend to open URLs as well as files. diff --git a/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/objects.gorm b/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/objects.gorm index dffe82aa0..f1ee2e418 100644 Binary files a/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/objects.gorm and b/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/objects.gorm differ diff --git a/Source/GSToolbarCustomizationPalette.m b/Source/GSToolbarCustomizationPalette.m index 7f5950616..20b8838da 100644 --- a/Source/GSToolbarCustomizationPalette.m +++ b/Source/GSToolbarCustomizationPalette.m @@ -34,7 +34,7 @@ #include "AppKit/NSWindow.h" #include "AppKit/NSToolbar.h" #include "AppKit/NSToolbarItem.h" - +#include "AppKit/NSPopUpButton.h" #include "NSToolbarFrameworkPrivate.h" #include "GSToolbarCustomizationPalette.h" @@ -238,10 +238,12 @@ NSArray *itemIdentifiers = nil; NSEnumerator *e = nil; NSString *identifier = nil; + NSToolbarDisplayMode tag = [toolbar displayMode]; id delegate = [toolbar delegate]; [_allowedItems removeAllObjects]; [_defaultItems removeAllObjects]; + [_displayPopup selectItemWithTag: tag]; if (delegate == nil) { @@ -304,4 +306,12 @@ RELEASE(self); } +- (void) show: (id) sender +{ + NSToolbarDisplayMode displayMode = (NSToolbarDisplayMode) + [[sender selectedItem] tag]; + [_toolbar setDisplayMode: displayMode]; + [_toolbar _saveConfig]; +} + @end diff --git a/Source/NSToolbar.m b/Source/NSToolbar.m index 936b8ad47..022af63fe 100644 --- a/Source/NSToolbar.m +++ b/Source/NSToolbar.m @@ -894,7 +894,18 @@ static GSValidationCenter *vc = nil; NSEnumerator *e; id itemIdentifier; int i = 0; - + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSString *tableKey = + [NSString stringWithFormat: @"NSToolbar Config %@",_identifier]; + NSDictionary *config = [defaults objectForKey: tableKey]; + NSToolbarDisplayMode displayMode = 0; + + if(config) + { + displayMode = (NSToolbarDisplayMode)[[config objectForKey: @"displayMode"] intValue]; + [self setDisplayMode: displayMode]; + } + // Switch off toolbar view reload _build = YES;