mirror of
https://github.com/aseprite/aseprite.git
synced 2024-09-02 04:59:24 +00:00
Add Alt+Shift+G shortcut to toogle the pixel grid visibility (fix #504)
This commit is contained in:
parent
80073e65d1
commit
c6aedc117a
@ -88,6 +88,7 @@
|
||||
<key command="SplitEditorHorizontally" shortcut="Ctrl+3" mac="Cmd+3" />
|
||||
<key command="Preview" shortcut="F8" />
|
||||
<key command="ShowGrid" shortcut="Shift+G" />
|
||||
<key command="ShowPixelGrid" shortcut="Alt+Shift+G" />
|
||||
<key command="SnapToGrid" shortcut="Shift+S" />
|
||||
<key command="ShowOnionSkin" shortcut="F3" />
|
||||
<key command="Timeline" shortcut="Tab">
|
||||
|
@ -67,6 +67,33 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
class ShowPixelGridCommand : public Command {
|
||||
public:
|
||||
ShowPixelGridCommand()
|
||||
: Command("ShowPixelGrid",
|
||||
"Show Pixel Grid",
|
||||
CmdUIOnlyFlag)
|
||||
{
|
||||
}
|
||||
|
||||
Command* clone() const override { return new ShowPixelGridCommand(*this); }
|
||||
|
||||
protected:
|
||||
bool onChecked(Context* context)
|
||||
{
|
||||
IDocumentSettings* docSettings = context->settings()->getDocumentSettings(context->activeDocument());
|
||||
|
||||
return docSettings->getPixelGridVisible();
|
||||
}
|
||||
|
||||
void onExecute(Context* context)
|
||||
{
|
||||
IDocumentSettings* docSettings = context->settings()->getDocumentSettings(context->activeDocument());
|
||||
|
||||
docSettings->setPixelGridVisible(docSettings->getPixelGridVisible() ? false: true);
|
||||
}
|
||||
};
|
||||
|
||||
class SnapToGridCommand : public Command {
|
||||
public:
|
||||
SnapToGridCommand()
|
||||
@ -158,6 +185,11 @@ Command* CommandFactory::createShowGridCommand()
|
||||
return new ShowGridCommand;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createShowPixelGridCommand()
|
||||
{
|
||||
return new ShowPixelGridCommand;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createSnapToGridCommand()
|
||||
{
|
||||
return new SnapToGridCommand;
|
||||
|
@ -102,6 +102,7 @@ FOR_EACH_COMMAND(Scroll)
|
||||
FOR_EACH_COMMAND(SetPalette)
|
||||
FOR_EACH_COMMAND(ShowGrid)
|
||||
FOR_EACH_COMMAND(ShowOnionSkin)
|
||||
FOR_EACH_COMMAND(ShowPixelGrid)
|
||||
FOR_EACH_COMMAND(SnapToGrid)
|
||||
FOR_EACH_COMMAND(SplitEditorHorizontally)
|
||||
FOR_EACH_COMMAND(SplitEditorVertically)
|
||||
|
Loading…
Reference in New Issue
Block a user