summaryrefslogtreecommitdiff
path: root/src/filetree.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-01-20 23:25:53 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-02-04 03:33:21 -0500
commitdd4bd5b17ddedcaf64df09f7a10d34267b8834c3 (patch)
tree3e7d7ced274d7279070b0aebf84b0b8f889dc9a2 /src/filetree.cpp
parent2d4216a4f040f157b710eb0132f4049b4d69bddb (diff)
shift+right click for shell menu
Diffstat (limited to 'src/filetree.cpp')
-rw-r--r--src/filetree.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/filetree.cpp b/src/filetree.cpp
index 71a49200..3c99ab05 100644
--- a/src/filetree.cpp
+++ b/src/filetree.cpp
@@ -2,6 +2,7 @@
#include "filetreemodel.h"
#include "filetreeitem.h"
#include "organizercore.h"
+#include "envshell.h"
#include <log.h>
using namespace MOShared;
@@ -438,6 +439,23 @@ void FileTree::onExpandedChanged(const QModelIndex& index, bool expanded)
void FileTree::onContextMenu(const QPoint &pos)
{
+ const auto m = QApplication::keyboardModifiers();
+
+ if (m & Qt::ShiftModifier) {
+ if (auto* item=singleSelection()) {
+ if (!item->isDirectory()) {
+ const auto file = m_core.directoryStructure()->searchFile(
+ item->dataRelativeFilePath().toStdWString(), nullptr);
+
+ if (file) {
+ const QFileInfo fi(QString::fromStdWString(file->getFullPath()));
+ env::showShellMenu(m_tree, fi, m_tree->viewport()->mapToGlobal(pos));
+ return;
+ }
+ }
+ }
+ }
+
QMenu menu;
if (auto* item=singleSelection()) {