mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-17 16:11:28 +00:00
Fixed with nib2cib: toolbars with default items such as NSToolbarShowColorsItem didn't convert right.
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
@import <AppKit/CPToolbar.j>
|
||||
|
||||
// NS_CPToolbarItemIdentifierMap
|
||||
@import "NSToolbarItem.j"
|
||||
|
||||
@implementation CPToolbar (NSCoding)
|
||||
|
||||
@@ -35,7 +37,20 @@
|
||||
_allowsUserCustomization = [aCoder decodeBoolForKey:"NSToolbarAllowsUserCustomization"];
|
||||
_isVisible = [aCoder decodeBoolForKey:"NSToolbarPrefersToBeShown"];
|
||||
|
||||
_identifiedItems = [aCoder decodeObjectForKey:"NSToolbarIBIdentifiedItems"];
|
||||
_identifiedItems = [CPMutableDictionary dictionary];
|
||||
|
||||
var nsIdentifiedItems = [aCoder decodeObjectForKey:"NSToolbarIBIdentifiedItems"],
|
||||
key = nil,
|
||||
keyEnumerator = [nsIdentifiedItems keyEnumerator];
|
||||
|
||||
// Some of the item identifiers will be changed when loaded by NSToolbarItem, so we must change
|
||||
// the map to correspond.
|
||||
while (key = [keyEnumerator nextObject])
|
||||
{
|
||||
var transformedKey = NS_CPToolbarItemIdentifierMap[key] || key;
|
||||
[_identifiedItems setObject:[nsIdentifiedItems objectForKey:key] forKey:transformedKey];
|
||||
}
|
||||
|
||||
_defaultItems = [aCoder decodeObjectForKey:"NSToolbarIBDefaultItems"];
|
||||
_allowedItems = [aCoder decodeObjectForKey:"NSToolbarIBAllowedItems"];
|
||||
_selectableItems = [aCoder decodeObjectForKey:"NSToolbarIBSelectableItems"];
|
||||
|
||||
Reference in New Issue
Block a user