From f0d201dcf1fb46e172e950c6f1767c5e8e6b9495 Mon Sep 17 00:00:00 2001 From: Davide Garberi Date: Wed, 25 Jan 2023 22:44:17 +0100 Subject: [PATCH] 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 --- src/views/dolphinview.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index c84e642dc8..d16aa3b092 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);