Fix RemoveLayer command so it's disabled when we have no more layers to remove

This commit is contained in:
David Capello 2014-04-29 01:01:25 -03:00
parent 5601b07df6
commit 4d48e40484

View File

@ -54,9 +54,11 @@ RemoveLayerCommand::RemoveLayerCommand()
bool RemoveLayerCommand::onEnabled(Context* context)
{
ContextWriter writer(context);
Sprite* sprite(writer.sprite());
return (sprite != NULL);
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable |
ContextFlags::HasActiveSprite |
ContextFlags::HasActiveLayer |
ContextFlags::ActiveLayerIsReadable |
ContextFlags::ActiveLayerIsWritable);
}
void RemoveLayerCommand::onExecute(Context* context)