mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-03 19:44:22 +00:00
Fix for targets and actions not working in nib2cibed toolbars.
Reviewed by me.
This commit is contained in:
1 parent
a45668e7cb
commit
99c1d18d95
4 files changed
+15
-16
No files matched your search
+8
-1
@@ -468,7 +468,14 @@ var CPToolbarIdentifierKey = @"CPToolbarIdentifierKey",
|
||||
// specified, it will be read later and the resulting call to -setDelegate:
|
||||
// will cause -_reloadToolbarItems] to run again :-(
|
||||
// FIXME: Can we make this better?
|
||||
[self _reloadToolbarItems];
|
||||
|
||||
// Do this at the end of the run loop to allow all the cib-stuff to
|
||||
// finish (establishing connections, etc.).
|
||||
[[CPRunLoop currentRunLoop]
|
||||
performSelector:@selector(_reloadToolbarItems)
|
||||
target:self
|
||||
argument:nil
|
||||
order:0 modes:[CPDefaultRunLoopMode]];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -51,8 +51,9 @@ var FILE = require("file");
|
||||
else
|
||||
size = imageSize(FILE.join(FILE.cwd(), resourcePath));
|
||||
|
||||
if (resourcePath && FILE.basename(resourcePath) !== FILE.basename(_resourceName))
|
||||
_resourceName = (_resourceName.indexOf("/") === -1 ? "" : FILE.dirname(_resourceName)) + FILE.basename(resourcePath);
|
||||
// Account for the fact that an extension may have been inferred.
|
||||
if (resourcePath && FILE.extension(resourcePath) !== FILE.extension(_resourceName))
|
||||
_resourceName += FILE.extension(resourcePath);
|
||||
}
|
||||
|
||||
_properties = [CPDictionary dictionaryWithObject:size forKey:@"size"];
|
||||
|
||||
@@ -59,7 +59,6 @@ NS_CPToolbarItemIdentifierMap =
|
||||
[self setAction:CPSelectorFromString([aCoder decodeObjectForKey:@"NSToolbarItemAction"])];
|
||||
[self setEnabled:[aCoder decodeBoolForKey:@"NSToolbarItemEnabled"]];
|
||||
|
||||
var image = [aCoder decodeObjectForKey:@"NSToolbarItemImage"];
|
||||
[self setImage:[aCoder decodeObjectForKey:@"NSToolbarItemImage"]];
|
||||
|
||||
//FIXME: we shouldn't let toolbars have images which are too big at all
|
||||
|
||||
@@ -68,18 +68,10 @@ var File = require("file");
|
||||
else if (File.isDirectory(path))
|
||||
pathGroups.push(File.listPaths(path));
|
||||
|
||||
else if (!File.extension(aName))
|
||||
{
|
||||
var extensions = ["png", "gif", "jpg", "jpeg", "cib"],
|
||||
extensionCount = extensions.length,
|
||||
extension;
|
||||
|
||||
while(extensionCount--)
|
||||
{
|
||||
if (File.basename(path) === aName+"."+extensions[extensionCount])
|
||||
return path;
|
||||
}
|
||||
}
|
||||
else if (!File.extension(aName) &&
|
||||
File.basename(path) === aName &&
|
||||
["png", "gif", "jpg", "jpeg", "cib"].indexOf(FILE.extension(path)) !== -1)
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user