2015-02-12 23:16:25 +08:00
|
|
|
// Aseprite
|
|
|
|
// Copyright (C) 2001-2015 David Capello
|
|
|
|
//
|
2016-08-27 04:02:58 +08:00
|
|
|
// This program is distributed under the terms of
|
|
|
|
// the End-User License Agreement for Aseprite.
|
2014-05-08 19:47:45 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "app/app.h"
|
|
|
|
#include "app/commands/command.h"
|
|
|
|
#include "app/context.h"
|
2014-09-09 10:08:06 +08:00
|
|
|
#include "app/document.h"
|
2015-02-15 20:48:38 +08:00
|
|
|
#include "app/pref/preferences.h"
|
2014-05-08 19:47:45 +08:00
|
|
|
|
|
|
|
namespace app {
|
|
|
|
|
|
|
|
using namespace gfx;
|
|
|
|
|
|
|
|
class ShowOnionSkinCommand : public Command {
|
|
|
|
public:
|
|
|
|
ShowOnionSkinCommand()
|
|
|
|
: Command("ShowOnionSkin",
|
|
|
|
"Show Onion Skin",
|
|
|
|
CmdUIOnlyFlag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-08-15 10:07:47 +08:00
|
|
|
Command* clone() const override { return new ShowOnionSkinCommand(*this); }
|
2014-05-08 19:47:45 +08:00
|
|
|
|
|
|
|
protected:
|
2015-10-01 03:34:43 +08:00
|
|
|
bool onChecked(Context* context) override {
|
2015-05-19 03:53:25 +08:00
|
|
|
DocumentPreferences& docPref = Preferences::instance().document(context->activeDocument());
|
2015-02-15 20:48:38 +08:00
|
|
|
return docPref.onionskin.active();
|
2014-05-08 19:47:45 +08:00
|
|
|
}
|
|
|
|
|
2015-10-01 03:34:43 +08:00
|
|
|
void onExecute(Context* context) override {
|
2015-05-19 03:53:25 +08:00
|
|
|
DocumentPreferences& docPref = Preferences::instance().document(context->activeDocument());
|
2015-02-15 20:48:38 +08:00
|
|
|
docPref.onionskin.active(!docPref.onionskin.active());
|
2014-05-08 19:47:45 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Command* CommandFactory::createShowOnionSkinCommand()
|
|
|
|
{
|
|
|
|
return new ShowOnionSkinCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace app
|