Reformat SwapCheckerboardColorsCommand file

This commit is contained in:
David Capello 2020-06-04 16:58:30 -03:00
parent e4b224a0bd
commit 1068926f7b

View File

@ -17,37 +17,37 @@
namespace app {
class SwapCheckerboardColorsCommand : public Command {
public:
SwapCheckerboardColorsCommand();
class SwapCheckerboardColorsCommand : public Command {
public:
SwapCheckerboardColorsCommand();
protected:
bool onEnabled(Context* context) override;
void onExecute(Context* context) override;
};
protected:
bool onEnabled(Context* context) override;
void onExecute(Context* context) override;
};
SwapCheckerboardColorsCommand::SwapCheckerboardColorsCommand()
: Command(CommandId::SwapCheckerboardColors(), CmdUIOnlyFlag)
{
}
SwapCheckerboardColorsCommand::SwapCheckerboardColorsCommand()
: Command(CommandId::SwapCheckerboardColors(), CmdUIOnlyFlag)
{
}
bool SwapCheckerboardColorsCommand::onEnabled(Context* context)
{
return true;
}
bool SwapCheckerboardColorsCommand::onEnabled(Context* context)
{
return true;
}
void SwapCheckerboardColorsCommand::onExecute(Context* context)
{
DocumentPreferences& docPref = Preferences::instance().document(context->activeDocument());
app::Color c1 = docPref.bg.color1();
app::Color c2 = docPref.bg.color2();
void SwapCheckerboardColorsCommand::onExecute(Context* context)
{
DocumentPreferences& docPref = Preferences::instance().document(context->activeDocument());
app::Color c1 = docPref.bg.color1();
app::Color c2 = docPref.bg.color2();
docPref.bg.color1(c2);
docPref.bg.color2(c1);
}
Command* CommandFactory::createSwapCheckerboardColorsCommand()
{
return new SwapCheckerboardColorsCommand;
}
docPref.bg.color1(c2);
docPref.bg.color2(c1);
}
Command* CommandFactory::createSwapCheckerboardColorsCommand()
{
return new SwapCheckerboardColorsCommand;
}
} // namespace app