diff options
| author | Davide Garberi <[email protected]> | 2023-01-25 22:44:17 +0100 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2023-02-01 10:20:09 +0000 |
| commit | f0d201dcf1fb46e172e950c6f1767c5e8e6b9495 (patch) | |
| tree | 7844808dfd0387f1e1faf90263b356dd45d1ee8b /src | |
| parent | e4e68b90b18806e3a7de872376a8b9e7da3561b3 (diff) | |
dolphinview: Fix right click broken on placeholderLabel
* This commit fixes the right click context menu not being shown
whenever the click is made right on the placeholderLabel text
Signed-off-by: Davide Garberi <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/views/dolphinview.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index c84e642dc..d16aa3b09 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -161,6 +161,10 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) : auto *centeringLayout = new QVBoxLayout(m_container); centeringLayout->addWidget(m_placeholderLabel); centeringLayout->setAlignment(m_placeholderLabel, Qt::AlignCenter); + m_placeholderLabel->setContextMenuPolicy(Qt::CustomContextMenu); + connect(m_placeholderLabel, &QWidget::customContextMenuRequested, this, [this](const QPoint& pos){ + slotViewContextMenuRequested(m_placeholderLabel->mapToGlobal(pos)); + }); controller->setSelectionBehavior(KItemListController::MultiSelection); connect(controller, &KItemListController::itemActivated, this, &DolphinView::slotItemActivated); |
