1
0

revert: remove protected mode

protected mode is designed for borderless and transparent window.
it is not suit for the goal of this fork.
This commit is contained in:
2026-07-03 14:32:30 +08:00
parent 6fde9474ae
commit c8dfccb460
4 changed files with 3 additions and 27 deletions

View File

@@ -62,7 +62,6 @@ void ActionManager::setupAction(MainWindow *mainWindow)
CREATE_NEW_ACTION(mainWindow, actionCopyFilePath); CREATE_NEW_ACTION(mainWindow, actionCopyFilePath);
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionPaste, edit-paste); CREATE_NEW_THEMEICON_ACTION(mainWindow, actionPaste, edit-paste);
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionTrash, edit-delete); CREATE_NEW_THEMEICON_ACTION(mainWindow, actionTrash, edit-delete);
CREATE_NEW_ACTION(mainWindow, actionToggleProtectMode);
CREATE_NEW_ACTION(mainWindow, actionToggleAvoidResetTransform); CREATE_NEW_ACTION(mainWindow, actionToggleAvoidResetTransform);
CREATE_NEW_ACTION(mainWindow, actionSettings); CREATE_NEW_ACTION(mainWindow, actionSettings);
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionHelp, system-help); CREATE_NEW_THEMEICON_ACTION(mainWindow, actionHelp, system-help);
@@ -104,7 +103,6 @@ void ActionManager::retranslateUi(MainWindow *mainWindow)
actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr)); actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr));
actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr)); actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr));
actionTrash->setText(QCoreApplication::translate("MainWindow", "Move to Trash", nullptr)); actionTrash->setText(QCoreApplication::translate("MainWindow", "Move to Trash", nullptr));
actionToggleProtectMode->setText(QCoreApplication::translate("MainWindow", "Protected mode", nullptr));
actionToggleAvoidResetTransform->setText(QCoreApplication::translate("MainWindow", "Keep transformation", "The 'transformation' means the flip/rotation status that currently applied to the image view")); actionToggleAvoidResetTransform->setText(QCoreApplication::translate("MainWindow", "Keep transformation", "The 'transformation' means the flip/rotation status that currently applied to the image view"));
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));

View File

@@ -45,7 +45,6 @@ public:
QAction *actionCopyFilePath; QAction *actionCopyFilePath;
QAction *actionPaste; QAction *actionPaste;
QAction *actionTrash; QAction *actionTrash;
QAction *actionToggleProtectMode;
QAction *actionToggleAvoidResetTransform; QAction *actionToggleAvoidResetTransform;
QAction *actionSettings; QAction *actionSettings;
QAction *actionHelp; QAction *actionHelp;

View File

@@ -441,10 +441,6 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
QAction * trash = m_am->actionTrash; QAction * trash = m_am->actionTrash;
QAction * protectedMode = m_am->actionToggleProtectMode;
protectedMode->setCheckable(true);
protectedMode->setChecked(m_protectedMode);
QAction * avoidResetTransform = m_am->actionToggleAvoidResetTransform; QAction * avoidResetTransform = m_am->actionToggleAvoidResetTransform;
avoidResetTransform->setCheckable(true); avoidResetTransform->setCheckable(true);
avoidResetTransform->setChecked(m_graphicsView->avoidResetTransform()); avoidResetTransform->setChecked(m_graphicsView->avoidResetTransform());
@@ -475,7 +471,6 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
menu->addAction(m_am->actionFitByWidth); menu->addAction(m_am->actionFitByWidth);
#endif // 0 #endif // 0
menu->addSeparator(); menu->addSeparator();
menu->addAction(protectedMode);
menu->addAction(avoidResetTransform); menu->addAction(avoidResetTransform);
menu->addSeparator(); menu->addSeparator();
menu->addAction(toggleSettings); menu->addAction(toggleSettings);
@@ -565,12 +560,6 @@ void MainWindow::updateWidgetsPosition()
m_gv->move(width() - m_gv->width(), height() - m_gv->height()); m_gv->move(width() - m_gv->width(), height() - m_gv->height());
} }
void MainWindow::toggleProtectedMode()
{
m_protectedMode = !m_protectedMode;
updateGalleryButtonsVisibility();
}
void MainWindow::toggleAvoidResetTransform() void MainWindow::toggleAvoidResetTransform()
{ {
m_graphicsView->setAvoidResetTransform(!m_graphicsView->avoidResetTransform()); m_graphicsView->setAvoidResetTransform(!m_graphicsView->avoidResetTransform());
@@ -596,9 +585,7 @@ bool MainWindow::canPaste() const
void MainWindow::quitAppAction(bool force) void MainWindow::quitAppAction(bool force)
{ {
if (!m_protectedMode || force) {
closeWindow(); closeWindow();
}
} }
void MainWindow::toggleFullscreen() void MainWindow::toggleFullscreen()
@@ -780,11 +767,6 @@ void MainWindow::on_actionAnimationNextFrame_triggered()
m_graphicsView->scene()->skipAnimationFrame(1); m_graphicsView->scene()->skipAnimationFrame(1);
} }
void MainWindow::on_actionToggleProtectMode_triggered()
{
toggleProtectedMode();
}
void MainWindow::on_actionToggleAvoidResetTransform_triggered() void MainWindow::on_actionToggleAvoidResetTransform_triggered()
{ {
toggleAvoidResetTransform(); toggleAvoidResetTransform();
@@ -869,8 +851,8 @@ void MainWindow::updateGalleryButtonsVisibility()
{ {
const int galleryFileCount = m_pm->totalCount(); const int galleryFileCount = m_pm->totalCount();
const bool loopGallery = Settings::instance()->loopGallery(); const bool loopGallery = Settings::instance()->loopGallery();
m_prevButton->setVisible(!m_protectedMode && galleryFileCount > 1); m_prevButton->setVisible(galleryFileCount > 1);
m_nextButton->setVisible(!m_protectedMode && galleryFileCount > 1); m_nextButton->setVisible(galleryFileCount > 1);
m_prevButton->setEnabled(loopGallery || !m_pm->isFirstIndex()); m_prevButton->setEnabled(loopGallery || !m_pm->isFirstIndex());
m_nextButton->setEnabled(loopGallery || !m_pm->isLastIndex()); m_nextButton->setEnabled(loopGallery || !m_pm->isLastIndex());
} }

View File

@@ -61,7 +61,6 @@ protected slots:
void centerWindow(); void centerWindow();
void closeWindow(); void closeWindow();
void updateWidgetsPosition(); void updateWidgetsPosition();
void toggleProtectedMode();
void toggleAvoidResetTransform(); void toggleAvoidResetTransform();
bool canPaste() const; bool canPaste() const;
void quitAppAction(bool force = false); void quitAppAction(bool force = false);
@@ -95,7 +94,6 @@ private slots:
void on_actionCopyFilePath_triggered(); void on_actionCopyFilePath_triggered();
void on_actionPaste_triggered(); void on_actionPaste_triggered();
void on_actionTrash_triggered(); void on_actionTrash_triggered();
void on_actionToggleProtectMode_triggered();
void on_actionToggleAvoidResetTransform_triggered(); void on_actionToggleAvoidResetTransform_triggered();
void on_actionSettings_triggered(); void on_actionSettings_triggered();
void on_actionHelp_triggered(); void on_actionHelp_triggered();
@@ -118,7 +116,6 @@ private:
GraphicsView *m_graphicsView; GraphicsView *m_graphicsView;
NavigatorView *m_gv; NavigatorView *m_gv;
BottomButtonGroup *m_bottomButtonGroup; BottomButtonGroup *m_bottomButtonGroup;
bool m_protectedMode = false;
bool m_clickedOnWindow = false; bool m_clickedOnWindow = false;
}; };