mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-21 09:50:41 +00:00
Fix for updating target/action of toolbar items.
Reviewed by me.
This commit is contained in:
+8
-1
@@ -896,7 +896,7 @@ var TOP_MARGIN = 5.0,
|
||||
|
||||
_toolbar = aToolbar;
|
||||
|
||||
var keyPaths = [@"label", @"image", @"alternateImage", @"minSize", @"maxSize", @"enabled"],
|
||||
var keyPaths = [@"label", @"image", @"alternateImage", @"minSize", @"maxSize", @"target", @"action", @"enabled"],
|
||||
index = 0,
|
||||
count = [keyPaths count];
|
||||
|
||||
@@ -1102,6 +1102,13 @@ var TOP_MARGIN = 5.0,
|
||||
{
|
||||
if (aKeyPath === "enabled")
|
||||
[self setEnabled:[anObject isEnabled]];
|
||||
|
||||
else if (aKeyPath === @"target")
|
||||
[self setTarget:[anObject target]];
|
||||
|
||||
else if (aKeyPath === @"action")
|
||||
[self setAction:[anObject action]];
|
||||
|
||||
else
|
||||
[self updateFromItem];
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ var CPToolbarItemItemIdentifierKey = @"CPToolbarItemItemIdentifierKey",
|
||||
|
||||
[self setTag:[aCoder decodeObjectForKey:CPToolbarItemTagKey]];
|
||||
[self setTarget:[aCoder decodeObjectForKey:CPToolbarItemTargetKey]];
|
||||
[self setAction:[aCoder decodeObjectForKey:CPToolbarItemActionKey]];
|
||||
[self setAction:CPSelectorFromString([aCoder decodeObjectForKey:CPToolbarItemActionKey])];
|
||||
|
||||
[self setEnabled:[aCoder decodeBoolForKey:CPToolbarItemEnabledKey]];
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ NS_CPToolbarItemIdentifierMap =
|
||||
[self setTag:[aCoder decodeObjectForKey:@"NSToolbarItemTag"]];
|
||||
[self setTarget:[aCoder decodeObjectForKey:@"NSToolbarItemTarget"]];
|
||||
[self setAction:CPSelectorFromString([aCoder decodeObjectForKey:@"NSToolbarItemAction"])];
|
||||
|
||||
[self setEnabled:[aCoder decodeBoolForKey:@"NSToolbarItemEnabled"]];
|
||||
|
||||
[self setImage:[aCoder decodeBoolForKey:@"NSToolbarItemImage"]];
|
||||
|
||||
Reference in New Issue
Block a user