aseprite/src/app/commands/cmd_onionskin.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.0 KiB
C++
Raw Normal View History

2015-02-12 23:16:25 +08:00
// Aseprite
// Copyright (C) 2001-2017 David Capello
2015-02-12 23:16:25 +08:00
//
2016-08-27 04:02:58 +08:00
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "app/app.h"
#include "app/commands/command.h"
#include "app/context.h"
2018-07-07 22:54:44 +08:00
#include "app/doc.h"
#include "app/pref/preferences.h"
namespace app {
using namespace gfx;
class ShowOnionSkinCommand : public Command {
public:
ShowOnionSkinCommand() : Command(CommandId::ShowOnionSkin(), CmdUIOnlyFlag) {}
protected:
bool onChecked(Context* context) override
{
DocumentPreferences& docPref = Preferences::instance().document(context->activeDocument());
return docPref.onionskin.active();
}
void onExecute(Context* context) override
{
DocumentPreferences& docPref = Preferences::instance().document(context->activeDocument());
docPref.onionskin.active(!docPref.onionskin.active());
}
};
Command* CommandFactory::createShowOnionSkinCommand()
{
return new ShowOnionSkinCommand;
}
} // namespace app