mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 03:44:16 +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="SplitEditorHorizontally" shortcut="Ctrl+3" mac="Cmd+3" />
|
||||||
<key command="Preview" shortcut="F8" />
|
<key command="Preview" shortcut="F8" />
|
||||||
<key command="ShowGrid" shortcut="Shift+G" />
|
<key command="ShowGrid" shortcut="Shift+G" />
|
||||||
|
<key command="ShowPixelGrid" shortcut="Alt+Shift+G" />
|
||||||
<key command="SnapToGrid" shortcut="Shift+S" />
|
<key command="SnapToGrid" shortcut="Shift+S" />
|
||||||
<key command="ShowOnionSkin" shortcut="F3" />
|
<key command="ShowOnionSkin" shortcut="F3" />
|
||||||
<key command="Timeline" shortcut="Tab">
|
<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 {
|
class SnapToGridCommand : public Command {
|
||||||
public:
|
public:
|
||||||
SnapToGridCommand()
|
SnapToGridCommand()
|
||||||
@ -158,6 +185,11 @@ Command* CommandFactory::createShowGridCommand()
|
|||||||
return new ShowGridCommand;
|
return new ShowGridCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Command* CommandFactory::createShowPixelGridCommand()
|
||||||
|
{
|
||||||
|
return new ShowPixelGridCommand;
|
||||||
|
}
|
||||||
|
|
||||||
Command* CommandFactory::createSnapToGridCommand()
|
Command* CommandFactory::createSnapToGridCommand()
|
||||||
{
|
{
|
||||||
return new SnapToGridCommand;
|
return new SnapToGridCommand;
|
||||||
|
@ -102,6 +102,7 @@ FOR_EACH_COMMAND(Scroll)
|
|||||||
FOR_EACH_COMMAND(SetPalette)
|
FOR_EACH_COMMAND(SetPalette)
|
||||||
FOR_EACH_COMMAND(ShowGrid)
|
FOR_EACH_COMMAND(ShowGrid)
|
||||||
FOR_EACH_COMMAND(ShowOnionSkin)
|
FOR_EACH_COMMAND(ShowOnionSkin)
|
||||||
|
FOR_EACH_COMMAND(ShowPixelGrid)
|
||||||
FOR_EACH_COMMAND(SnapToGrid)
|
FOR_EACH_COMMAND(SnapToGrid)
|
||||||
FOR_EACH_COMMAND(SplitEditorHorizontally)
|
FOR_EACH_COMMAND(SplitEditorHorizontally)
|
||||||
FOR_EACH_COMMAND(SplitEditorVertically)
|
FOR_EACH_COMMAND(SplitEditorVertically)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user