diff --git a/app/imageopscontextmanageritem.cpp b/app/imageopscontextmanageritem.cpp --- a/app/imageopscontextmanageritem.cpp +++ b/app/imageopscontextmanageritem.cpp @@ -85,7 +85,7 @@ mRotateLeftAction->setText(i18n("Rotate Left")); mRotateLeftAction->setToolTip(i18nc("@info:tooltip", "Rotate image to the left")); mRotateLeftAction->setIcon(QIcon::fromTheme("object-rotate-left")); - actionCollection->setDefaultShortcut(mRotateLeftAction, Qt::CTRL + Qt::Key_L); + actionCollection->setDefaultShortcut(mRotateLeftAction, Qt::CTRL + Qt::SHIFT + Qt::Key_R); mRotateRightAction = edit->addAction("rotate_right", q, SLOT(rotateRight())); mRotateRightAction->setText(i18n("Rotate Right")); diff --git a/app/mainwindow.h b/app/mainwindow.h --- a/app/mainwindow.h +++ b/app/mainwindow.h @@ -128,6 +128,8 @@ void showFirstDocumentReached(); void showLastDocumentReached(); + + void replaceLocation(); private: struct Private; diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -24,6 +24,7 @@ // Qt #include #include +#include #include #include #include @@ -50,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -373,7 +375,7 @@ mFileOpenRecentAction = KStandardAction::openRecent(q, SLOT(openUrl(QUrl)), q); connect(mFileOpenRecentAction, &KRecentFilesAction::recentListCleared, mGvCore, &GvCore::clearRecentFilesAndFolders); - QAction* clearAction = mFileOpenRecentAction->menu()->findChild("clear_action"); + QAction * clearAction = mFileOpenRecentAction->menu()->findChild("clear_action"); if (clearAction) { clearAction->setText(i18nc("@action Open Recent menu", "Forget All Files && Folders")); } @@ -385,6 +387,11 @@ action->setText(i18nc("@action reload the currently viewed image", "Reload")); action->setIcon(QIcon::fromTheme("view-refresh")); actionCollection->setDefaultShortcuts(action, KStandardShortcut::reload()); + + QAction * replaceLocationAction = actionCollection->addAction(QStringLiteral("replace_location")); + replaceLocationAction->setText(i18nc("@action:inmenu Navigation Bar", "Replace Location")); + actionCollection->setDefaultShortcut(replaceLocationAction, Qt::CTRL + Qt::Key_L); + connect(replaceLocationAction, &QAction::triggered, q, &MainWindow::replaceLocation); mBrowseAction = view->addAction("browse"); mBrowseAction->setText(i18nc("@action:intoolbar Switch to file list", "Browse")); @@ -1721,4 +1728,21 @@ d->mViewMainPage->showMessageWidget(dlg, Qt::AlignCenter); } +void MainWindow::replaceLocation() +{ + QLineEdit* lineEdit = d->mUrlNavigator->editor()->lineEdit(); + + // If the text field currently has focus and everything is selected, + // pressing the keyboard shortcut returns the whole thing to breadcrumb mode + if (d->mUrlNavigator->isUrlEditable() + && lineEdit->hasFocus() + && lineEdit->selectedText() == lineEdit->text() ) { + d->mUrlNavigator->setUrlEditable(false); + } else { + d->mUrlNavigator->setUrlEditable(true); + d->mUrlNavigator->setFocus(); + lineEdit->selectAll(); + } +} + } // namespace