feat: add "Keep transformation" to menu

This could be helpful when viewing a gallery with similar size, which
need to apply same transformation to the view. E.g. When viewing a batch
of pixel image sprite assets, the view might need to be zoomed to clearly
view the detail of the image.

Other use-case can be seen at the linked issue below.

https://github.com/BLumia/pineapple-pictures/issues/87
https://github.com/BLumia/pineapple-pictures/issues/89
This commit is contained in:
Gary Wang 2023-10-15 17:12:46 +08:00
parent 27be83184e
commit 6e5bde68d8
No known key found for this signature in database
GPG Key ID: 5D30A4F15EA78760
3 changed files with 4 additions and 3 deletions

View File

@ -41,6 +41,9 @@ AboutDialog::AboutDialog(QWidget *parent)
QStringLiteral("<li><b>%1</b>:<br/>%2</li>") QStringLiteral("<li><b>%1</b>:<br/>%2</li>")
.arg(QCoreApplication::translate("MainWindow", "Protected mode")) .arg(QCoreApplication::translate("MainWindow", "Protected mode"))
.arg(tr("Avoid close window accidentally. (eg. by double clicking the window)")), .arg(tr("Avoid close window accidentally. (eg. by double clicking the window)")),
QStringLiteral("<li><b>%1</b>:<br/>%2</li>")
.arg(QCoreApplication::translate("MainWindow", "Keep transformation"))
.arg(tr("Avoid resetting the zoom/rotation/flip state that was applied to the image view when switching between images.")),
QStringLiteral("</ul>") QStringLiteral("</ul>")
}; };

View File

@ -105,7 +105,7 @@ void ActionManager::retranslateUi(MainWindow *mainWindow)
actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr)); actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr));
actionToggleStayOnTop->setText(QCoreApplication::translate("MainWindow", "Stay on top", nullptr)); actionToggleStayOnTop->setText(QCoreApplication::translate("MainWindow", "Stay on top", nullptr));
actionToggleProtectMode->setText(QCoreApplication::translate("MainWindow", "Protected mode", nullptr)); actionToggleProtectMode->setText(QCoreApplication::translate("MainWindow", "Protected mode", nullptr));
actionToggleAvoidResetTransform->setText("Avoid reset transform"); // TODO: what should it called? actionToggleAvoidResetTransform->setText(QCoreApplication::translate("MainWindow", "Keep transformation", "The 'transformation' means the flip/rotation status that currently applied to the image"));
actionSettings->setText(QCoreApplication::translate("MainWindow", "Configure...", nullptr)); actionSettings->setText(QCoreApplication::translate("MainWindow", "Configure...", nullptr));
actionHelp->setText(QCoreApplication::translate("MainWindow", "Help", nullptr)); actionHelp->setText(QCoreApplication::translate("MainWindow", "Help", nullptr));
#ifdef Q_OS_WIN #ifdef Q_OS_WIN

View File

@ -485,9 +485,7 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
menu->addSeparator(); menu->addSeparator();
menu->addAction(stayOnTopMode); menu->addAction(stayOnTopMode);
menu->addAction(protectedMode); menu->addAction(protectedMode);
#if 0
menu->addAction(avoidResetTransform); menu->addAction(avoidResetTransform);
#endif // 0
menu->addSeparator(); menu->addSeparator();
menu->addAction(toggleSettings); menu->addAction(toggleSettings);
menu->addAction(helpAction); menu->addAction(helpAction);