Toggle Shortcut

This commit is contained in:
Jeremy Bullock 2016-06-09 22:02:48 -06:00
parent 5162807399
commit eccbe0c583
3 changed files with 26 additions and 1 deletions

View file

@ -37,6 +37,12 @@ void enableOnionSkin(bool enable = true)
osmh->notifyOnionSkinMaskChanged();
}
void enableZeroThick(bool enable = true)
{
Preferences::instance()->setShow0ThickLines(enable);
TApp::instance()->getCurrentScene()->notifySceneChanged();
}
bool isOnionSkinEnabled()
{
TOnionSkinMaskHandle *osmh = TApp::instance()->getCurrentOnionSkin();
@ -681,3 +687,20 @@ public:
enableOnionSkin(checked);
}
} onionSkinToggle;
class ZeroThickToggle : public MenuItemHandler
{
public:
ZeroThickToggle() : MenuItemHandler(MI_ZeroThick)
{
}
void execute()
{
QAction *action = CommandManager::instance()->getAction(MI_ZeroThick);
if (!action)
return;
bool checked = action->isChecked();
enableZeroThick(checked);
}
} ZeroThickToggle;

View file

@ -1853,7 +1853,8 @@ void MainWindow::defineActions()
createRightClickMenuAction(MI_BlendColors, tr("&Blend colors"), "");
createToggle(MI_OnionSkin, tr("Onion Skin"), "", false, RightClickMenuCommandType);
createToggle(MI_OnionSkin, tr("Onion Skin"), "/", false, RightClickMenuCommandType);
createToggle(MI_ZeroThick, tr("Zero Thick Lines"), "Shift+/", false, RightClickMenuCommandType);
//createRightClickMenuAction(MI_LoadSubSceneFile, tr("Load As Sub-xsheet"), "");
//createRightClickMenuAction(MI_LoadResourceFile, tr("Load"), "");

View file

@ -218,6 +218,7 @@
#define MI_ResetRoomLayout "MI_ResetRoomLayout"
#define MI_OnionSkin "MI_OnionSkin"
#define MI_ZeroThick "MI_ZeroThick"
//#define MI_LoadResourceFile "MI_LoadResourceFile"
#define MI_DuplicateFile "MI_DuplicateFile"