Changes for size mode support.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28113 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2009-03-21 16:34:15 +00:00
parent 405c40fedc
commit 37efe84aac
5 changed files with 30 additions and 1 deletions

View file

@ -1,3 +1,13 @@
2009-03-21 12:27-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Panels/English.lproj/GSToolbarCustomizationPalette.gorm: Added
size: method to class in gorm file. Added connection to size: method
from the switch.
* Source/GSToolbarCustomizationPalette.m: Added size: method
implementation.
* Source/NSToolbar.m: Added code to save and load sizeMode attribute
for toolbar.
2009-03-21 12:13-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Panels/English.lproj/GSToolbarCustomizationPalette.gorm: Changed

View file

@ -2,6 +2,7 @@
"## Comment" = "Do NOT change this file, Gorm maintains it";
FirstResponder = {
Actions = (
"size:",
"reset:",
"show:"
);
@ -10,7 +11,8 @@
GSToolbarCustomizationPalette = {
Actions = (
"show:",
"reset:"
"reset:",
"size:"
);
Outlets = (
_customizationWindow,

View file

@ -303,6 +303,19 @@
[_toolbar _resetConfig];
}
- (void) size: (id) sender
{
NSToolbarSizeMode mode = NSToolbarSizeModeRegular;
if([sender state] == NSOnState)
{
mode = NSToolbarSizeModeSmall;
}
[_toolbar setSizeMode: mode];
[_toolbar _saveConfig];
}
- (void) paletteDidEnd: (NSNotification *)notif
{
[_toolbar _setCustomizationPaletteIsRunning: NO];

View file

@ -899,11 +899,14 @@ static GSValidationCenter *vc = nil;
[NSString stringWithFormat: @"NSToolbar Config %@",_identifier];
NSDictionary *config = [defaults objectForKey: tableKey];
NSToolbarDisplayMode displayMode = 0;
NSToolbarSizeMode sizeMode = 0;
if(config)
{
displayMode = (NSToolbarDisplayMode)[[config objectForKey: @"displayMode"] intValue];
[self setDisplayMode: displayMode];
sizeMode = (NSToolbarDisplayMode)[[config objectForKey: @"sizeMode"] intValue];
[self setSizeMode: sizeMode];
}
// Switch off toolbar view reload
@ -1022,6 +1025,7 @@ static GSValidationCenter *vc = nil;
[config setObject: [NSNumber numberWithBool: _visible] forKey: @"isVisible"];
[config setObject: [NSNumber numberWithInt: _displayMode] forKey: @"displayMode"];
[config setObject: [NSNumber numberWithInt: _sizeMode] forKey: @"sizeMode"];
while((item = [en nextObject]) != nil)
{
[items addObject: [item itemIdentifier]];