Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated shortcuts #1866

Merged
merged 7 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ HEADERS += \
src/shortcutspage.h \
src/timelinepage.h \
src/toolspage.h \
src/preview.h \
src/basedockwidget.h \
src/colorbox.h \
src/colorinspector.h \
Expand Down Expand Up @@ -140,7 +139,6 @@ SOURCES += \
src/shortcutspage.cpp \
src/timelinepage.cpp \
src/toolspage.cpp \
src/preview.cpp \
src/basedockwidget.cpp \
src/colorbox.cpp \
src/colorinspector.cpp \
Expand Down
2 changes: 1 addition & 1 deletion app/src/filedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ QString FileDialog::saveDialogCaption(FileType fileType)
case FileType::GIF: return tr("Export Animated GIF");
case FileType::ANIMATED_IMAGE: return tr("Export animated image");
case FileType::MOVIE: return tr("Export movie");
case FileType::SOUND: return tr("Export sound");
case FileType::SOUND: return "";
case FileType::PALETTE: return tr("Export palette");
}
return "";
Expand Down
27 changes: 24 additions & 3 deletions app/src/mainwindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ GNU General Public License for more details.
#include "pegbaralignmentdialog.h"
#include "repositionframesdialog.h"

//#include "preview.h"
#include "errordialog.h"
#include "filedialog.h"
#include "importimageseqdialog.h"
Expand Down Expand Up @@ -1165,21 +1164,27 @@ void MainWindow2::setupKeyboardShortcuts()
return keySequence;
};

// File menu
ui->actionNew->setShortcut(cmdKeySeq(CMD_NEW_FILE));
ui->actionOpen->setShortcut(cmdKeySeq(CMD_OPEN_FILE));
ui->actionSave->setShortcut(cmdKeySeq(CMD_SAVE_FILE));
ui->actionSave_as->setShortcut(cmdKeySeq(CMD_SAVE_AS));

ui->actionImport_Image->setShortcut(cmdKeySeq(CMD_IMPORT_IMAGE));
ui->actionImport_ImageSeq->setShortcut(cmdKeySeq(CMD_IMPORT_IMAGE_SEQ));
ui->actionImport_ImageSeqNum->setShortcut(cmdKeySeq(CMD_IMPORT_IMAGE_PREDEFINED_SET));
ui->actionImport_MovieVideo->setShortcut(cmdKeySeq(CMD_IMPORT_MOVIE_VIDEO));
ui->actionImport_AnimatedImage->setShortcut(cmdKeySeq(CMD_IMPORT_ANIMATED_IMAGE));
ui->actionImportLayers_from_pclx->setShortcut(cmdKeySeq(CMD_IMPORT_LAYERS));
ui->actionImport_Sound->setShortcut(cmdKeySeq(CMD_IMPORT_SOUND));
ui->actionImport_MovieAudio->setShortcut(cmdKeySeq(CMD_IMPORT_MOVIE_AUDIO));
ui->actionImport_Append_Palette->setShortcut(cmdKeySeq(CMD_IMPORT_PALETTE));
ui->actionImport_Sound->setShortcut(cmdKeySeq(CMD_IMPORT_SOUND));
ui->actionImport_Replace_Palette->setShortcut(cmdKeySeq(CMD_IMPORT_PALETTE_REPLACE));

ui->actionExport_Image->setShortcut(cmdKeySeq(CMD_EXPORT_IMAGE));
ui->actionExport_ImageSeq->setShortcut(cmdKeySeq(CMD_EXPORT_IMAGE_SEQ));
ui->actionExport_Movie->setShortcut(cmdKeySeq(CMD_EXPORT_MOVIE));
ui->actionExport_Animated_GIF->setShortcut(cmdKeySeq(CMD_EXPORT_GIF));
ui->actionExport_Palette->setShortcut(cmdKeySeq(CMD_EXPORT_PALETTE));

// edit menu
Expand All @@ -1194,10 +1199,12 @@ void MainWindow2::setupKeyboardShortcuts()
ui->actionFlip_Y->setShortcut(cmdKeySeq(CMD_SELECTION_FLIP_VERTICAL));
ui->actionSelect_All->setShortcut(cmdKeySeq(CMD_SELECT_ALL));
ui->actionDeselect_All->setShortcut(cmdKeySeq(CMD_DESELECT_ALL));
ui->actionPegbarAlignment->setShortcut(cmdKeySeq(CMD_PEGBAR_ALIGNMENT));
ui->actionPreference->setShortcut(cmdKeySeq(CMD_PREFERENCE));

// View menu
ui->actionResetWindows->setShortcut(cmdKeySeq(CMD_RESET_WINDOWS));
ui->actionLockWindows->setShortcut(cmdKeySeq(CMD_LOCK_WINDOWS));
ui->actionReset_View->setShortcut(cmdKeySeq(CMD_RESET_ZOOM_ROTATE));
ui->actionCenter_View->setShortcut(cmdKeySeq(CMD_CENTER_VIEW));
ui->actionZoom_In->setShortcut(cmdKeySeq(CMD_ZOOM_IN));
Expand All @@ -1214,14 +1221,22 @@ void MainWindow2::setupKeyboardShortcuts()
ui->actionReset_Rotation->setShortcut(cmdKeySeq(CMD_RESET_ROTATION));
ui->actionHorizontal_Flip->setShortcut(cmdKeySeq(CMD_FLIP_HORIZONTAL));
ui->actionVertical_Flip->setShortcut(cmdKeySeq(CMD_FLIP_VERTICAL));
ui->actionPreview->setShortcut(cmdKeySeq(CMD_PREVIEW));
ui->actionGrid->setShortcut(cmdKeySeq(CMD_GRID));
ui->actionCenter->setShortcut(cmdKeySeq(CMD_OVERLAY_CENTER));
ui->actionThirds->setShortcut(cmdKeySeq(CMD_OVERLAY_THIRDS));
ui->actionGoldenRatio->setShortcut(cmdKeySeq(CMD_OVERLAY_GOLDEN_RATIO));
ui->actionSafeAreas->setShortcut(cmdKeySeq(CMD_OVERLAY_SAFE_AREAS));
ui->actionOnePointPerspective->setShortcut(cmdKeySeq(CMD_OVERLAY_ONE_POINT_PERSPECTIVE));
ui->actionTwoPointPerspective->setShortcut(cmdKeySeq(CMD_OVERLAY_TWO_POINT_PERSPECTIVE));
ui->actionThreePointPerspective->setShortcut(cmdKeySeq(CMD_OVERLAY_THREE_POINT_PERSPECTIVE));
ui->actionOnionPrev->setShortcut(cmdKeySeq(CMD_ONIONSKIN_PREV));
ui->actionOnionNext->setShortcut(cmdKeySeq(CMD_ONIONSKIN_NEXT));
ui->actionStatusBar->setShortcut(cmdKeySeq(CMD_TOGGLE_STATUS_BAR));

// Animation menu
ui->actionPlay->setShortcut(cmdKeySeq(CMD_PLAY));
ui->actionLoop->setShortcut(cmdKeySeq(CMD_LOOP));
ui->actionLoopControl->setShortcut(cmdKeySeq(CMD_LOOP_CONTROL));
ui->actionPrevious_Frame->setShortcut(cmdKeySeq(CMD_GOTO_PREV_FRAME));
ui->actionNext_Frame->setShortcut(cmdKeySeq(CMD_GOTO_NEXT_FRAME));
ui->actionPrev_KeyFrame->setShortcut(cmdKeySeq(CMD_GOTO_PREV_KEY_FRAME));
Expand All @@ -1237,6 +1252,7 @@ void MainWindow2::setupKeyboardShortcuts()
ui->actionMove_Frame_Forward->setShortcut(cmdKeySeq(CMD_MOVE_FRAME_FORWARD));
ui->actionFlip_inbetween->setShortcut(cmdKeySeq(CMD_FLIP_INBETWEEN));
ui->actionFlip_rolling->setShortcut(cmdKeySeq(CMD_FLIP_ROLLING));
ui->actionReposition_Selected_Frames->setShortcut(cmdKeySeq(CMD_SELECTION_REPOSITION_FRAMES));

ShortcutFilter* shortcutFilter = new ShortcutFilter(ui->scribbleArea, this);
ui->actionMove->setShortcut(cmdKeySeq(CMD_TOOL_MOVE));
Expand All @@ -1250,6 +1266,7 @@ void MainWindow2::setupKeyboardShortcuts()
ui->actionBucket->setShortcut(cmdKeySeq(CMD_TOOL_BUCKET));
ui->actionEyedropper->setShortcut(cmdKeySeq(CMD_TOOL_EYEDROPPER));
ui->actionEraser->setShortcut(cmdKeySeq(CMD_TOOL_ERASER));
ui->actionResetToolsDefault->setShortcut(cmdKeySeq(CMD_RESET_ALL_TOOLS));

ui->actionMove->installEventFilter(shortcutFilter);
ui->actionMove->installEventFilter(shortcutFilter);
Expand All @@ -1264,11 +1281,15 @@ void MainWindow2::setupKeyboardShortcuts()
ui->actionEyedropper->installEventFilter(shortcutFilter);
ui->actionEraser->installEventFilter(shortcutFilter);

// Layer menu
ui->actionNew_Bitmap_Layer->setShortcut(cmdKeySeq(CMD_NEW_BITMAP_LAYER));
ui->actionNew_Vector_Layer->setShortcut(cmdKeySeq(CMD_NEW_VECTOR_LAYER));
ui->actionNew_Camera_Layer->setShortcut(cmdKeySeq(CMD_NEW_CAMERA_LAYER));
ui->actionNew_Sound_Layer->setShortcut(cmdKeySeq(CMD_NEW_SOUND_LAYER));
ui->actionDelete_Current_Layer->setShortcut(cmdKeySeq(CMD_DELETE_CUR_LAYER));
ui->actionChangeLineColorCurrent_keyframe->setShortcut(cmdKeySeq(CMD_CHANGE_LINE_COLOR_KEYFRAME));
ui->actionChangeLineColorAll_keyframes_on_layer->setShortcut(cmdKeySeq(CMD_CHANGE_LINE_COLOR_LAYER));
ui->actionChangeLayerOpacity->setShortcut(cmdKeySeq(CMD_CHANGE_LAYER_OPACITY));

ui->actionVisibilityCurrentLayerOnly->setShortcut(cmdKeySeq(CMD_CURRENT_LAYER_VISIBILITY));
ui->actionVisibilityRelative->setShortcut(cmdKeySeq(CMD_RELATIVE_LAYER_VISIBILITY));
Expand Down
46 changes: 0 additions & 46 deletions app/src/preview.cpp

This file was deleted.

54 changes: 0 additions & 54 deletions app/src/preview.h

This file was deleted.

25 changes: 23 additions & 2 deletions app/src/shortcutspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ static QString getHumanReadableShortcutName(const QString& cmdName)
{CMD_EXPORT_IMAGE, ShortcutsPage::tr("Export Image", "Shortcut")},
{CMD_EXPORT_IMAGE_SEQ, ShortcutsPage::tr("Export Image Sequence", "Shortcut")},
{CMD_EXPORT_MOVIE, ShortcutsPage::tr("Export Movie", "Shortcut")},
{CMD_EXPORT_GIF, ShortcutsPage::tr("Export Animated GIF", "Shortcut")},
{CMD_EXPORT_PALETTE, ShortcutsPage::tr("Export Palette", "Shortcut")},
{CMD_EXPORT_SOUND, ShortcutsPage::tr("Export Sound", "Shortcut")},
{CMD_FLIP_HORIZONTAL, ShortcutsPage::tr("View: Horizontal Flip", "Shortcut")},
{CMD_FLIP_VERTICAL, ShortcutsPage::tr("View: Vertical Flip", "Shortcut")},
{CMD_FLIP_INBETWEEN, ShortcutsPage::tr("Flip In-Between", "Shortcut")},
Expand All @@ -322,18 +322,34 @@ static QString getHumanReadableShortcutName(const QString& cmdName)
{CMD_SELECTION_FLIP_HORIZONTAL, ShortcutsPage::tr("Selection: Horizontal Flip", "Shortcut")},
{CMD_SELECTION_FLIP_VERTICAL, ShortcutsPage::tr("Selection: Vertical Flip", "Shortcut")},
{CMD_GOTO_PREV_KEY_FRAME, ShortcutsPage::tr("Previous Keyframe", "Shortcut")},
{CMD_SELECTION_REPOSITION_FRAMES, ShortcutsPage::tr("Selection: Reposition Frames", "Shortcut")},
{CMD_SELECTION_ADD_FRAME_EXPOSURE, ShortcutsPage::tr("Selection: Add Frame Exposure", "Shortcut")},
{CMD_SELECTION_SUBTRACT_FRAME_EXPOSURE, ShortcutsPage::tr("Selection: Subtract Frame Exposure", "Shortcut")},
{CMD_REVERSE_SELECTED_FRAMES, ShortcutsPage::tr("Selection: Reverse Keyframes", "Shortcut")},
{CMD_REMOVE_SELECTED_FRAMES, ShortcutsPage::tr("Selection: Remove Keyframes", "Shortcut")},
{CMD_GRID, ShortcutsPage::tr("Toggle Grid", "Shortcut")},
{CMD_OVERLAY_CENTER, ShortcutsPage::tr("Toggle Center Overlay", "Shortcut")},
{CMD_OVERLAY_THIRDS, ShortcutsPage::tr("Toggle Thirds Overlay", "Shortcut")},
{CMD_OVERLAY_GOLDEN_RATIO, ShortcutsPage::tr("Toggle Golden Ratio Overlay", "Shortcut")},
{CMD_OVERLAY_SAFE_AREAS, ShortcutsPage::tr("Toggle Safe Areas Overlay", "Shortcut")},
{CMD_OVERLAY_ONE_POINT_PERSPECTIVE, ShortcutsPage::tr("Toggle One Point Perspective Overlay", "Shortcut")},
{CMD_OVERLAY_TWO_POINT_PERSPECTIVE, ShortcutsPage::tr("Toggle Two Point Perspective Overlay", "Shortcut")},
{CMD_OVERLAY_THREE_POINT_PERSPECTIVE, ShortcutsPage::tr("Toggle Three Point Perspective Overlay", "Shortcut")},
{CMD_IMPORT_IMAGE, ShortcutsPage::tr("Import Image", "Shortcut")},
{CMD_IMPORT_IMAGE_SEQ, ShortcutsPage::tr("Import Image Sequence", "Shortcut")},
{CMD_IMPORT_IMAGE_PREDEFINED_SET, ShortcutsPage::tr("Import Image Predefined Set", "Shortcut")},
{CMD_IMPORT_MOVIE_VIDEO, ShortcutsPage::tr("Import Movie Video", "Shortcut")},
{CMD_IMPORT_MOVIE_AUDIO, ShortcutsPage::tr("Import Movie Audio", "Shortcut")},
{CMD_IMPORT_ANIMATED_IMAGE, ShortcutsPage::tr("Import Animated Image", "Shortcut")},
{CMD_IMPORT_LAYERS, ShortcutsPage::tr("Import Layers from project file", "Shortcut")},
{CMD_IMPORT_PALETTE, ShortcutsPage::tr("Import Palette (Append)", "Shortcut")},
{CMD_IMPORT_PALETTE_REPLACE, ShortcutsPage::tr("Import Palette (Replace)", "Shortcut")},
{CMD_IMPORT_SOUND, ShortcutsPage::tr("Import Sound", "Shortcut")},
{CMD_ALL_LAYER_VISIBILITY, ShortcutsPage::tr("Show All Layers", "Shortcut")},
{CMD_CURRENT_LAYER_VISIBILITY, ShortcutsPage::tr("Show Current Layer Only", "Shortcut")},
{CMD_RELATIVE_LAYER_VISIBILITY, ShortcutsPage::tr("Show Layers Relative to Current Layer", "Shortcut")},
{CMD_LOOP, ShortcutsPage::tr("Toggle Loop", "Shortcut")},
{CMD_LOOP_CONTROL, ShortcutsPage::tr("Toggle Range Playback", "Shortcut")},
{CMD_MOVE_FRAME_BACKWARD, ShortcutsPage::tr("Move Frame Backward", "Shortcut")},
{CMD_MOVE_FRAME_FORWARD, ShortcutsPage::tr("Move Frame Forward", "Shortcut")},
{CMD_NEW_BITMAP_LAYER, ShortcutsPage::tr("New Bitmap Layer", "Shortcut")},
Expand All @@ -346,11 +362,12 @@ static QString getHumanReadableShortcutName(const QString& cmdName)
{CMD_OPEN_FILE, ShortcutsPage::tr("Open File", "Shortcut")},
{CMD_PASTE, ShortcutsPage::tr("Paste", "Shortcut")},
{CMD_PLAY, ShortcutsPage::tr("Play/Stop", "Shortcut")},
{CMD_PEGBAR_ALIGNMENT, ShortcutsPage::tr("Peg bar Alignment", "Shortcut")},
{CMD_PREFERENCE, ShortcutsPage::tr("Preferences", "Shortcut")},
{CMD_PREVIEW, ShortcutsPage::tr("Preview", "Shortcut")},
{CMD_REDO, ShortcutsPage::tr("Redo", "Shortcut")},
{CMD_REMOVE_FRAME, ShortcutsPage::tr("Remove Frame", "Shortcut")},
{CMD_RESET_WINDOWS, ShortcutsPage::tr("Reset Windows", "Shortcut")},
{CMD_LOCK_WINDOWS, ShortcutsPage::tr("Lock Windows", "Shortcut")},
{CMD_RESET_ZOOM_ROTATE, ShortcutsPage::tr("Reset View", "Shortcut")},
{CMD_CENTER_VIEW, ShortcutsPage::tr("Center View", "Shortcut")},
{CMD_ROTATE_ANTI_CLOCK, ShortcutsPage::tr("Rotate Anticlockwise", "Shortcut")},
Expand Down Expand Up @@ -378,6 +395,10 @@ static QString getHumanReadableShortcutName(const QString& cmdName)
{CMD_TOOL_POLYLINE, ShortcutsPage::tr("Polyline Tool", "Shortcut")},
{CMD_TOOL_SELECT, ShortcutsPage::tr("Select Tool", "Shortcut")},
{CMD_TOOL_SMUDGE, ShortcutsPage::tr("Smudge Tool", "Shortcut")},
{CMD_RESET_ALL_TOOLS, ShortcutsPage::tr("Reset all tools to default", "Shortcut")},
{CMD_CHANGE_LINE_COLOR_KEYFRAME, ShortcutsPage::tr("Change Line Color (Current keyframe)", "Shortcut")},
{CMD_CHANGE_LINE_COLOR_LAYER, ShortcutsPage::tr("Change Line Color (All keyframes on layer)", "Shortcut")},
{CMD_CHANGE_LAYER_OPACITY, ShortcutsPage::tr("Change Layer / Keyframe Opacity", "Shortcut")},
{CMD_UNDO, ShortcutsPage::tr("Undo", "Shortcut")},
{CMD_ZOOM_100, ShortcutsPage::tr("Set Zoom to 100%", "Shortcut")},
{CMD_ZOOM_200, ShortcutsPage::tr("Set Zoom to 200%", "Shortcut")},
Expand Down
9 changes: 0 additions & 9 deletions app/ui/mainwindow2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@
<addaction name="actionShowInvisibleLines"/>
<addaction name="actionShowOutlinesOnly"/>
<addaction name="separator"/>
<addaction name="actionPreview"/>
</widget>
<widget class="QMenu" name="menuAnimation">
<property name="title">
Expand Down Expand Up @@ -564,14 +563,6 @@
<string>Vertical Flip</string>
</property>
</action>
<action name="actionPreview">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Preview</string>
</property>
</action>
<action name="actionGrid">
<property name="checkable">
<bool>true</bool>
Expand Down
Loading
Loading