mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Fix knewstuff popup menu position on wayland
On Wayland we need to pass a parent to popup menus. See https://community.kde.org/Guidelines_and_HOWTOs/Wayland_Porting_Notes#Popup_Menus So we use the new setParentWidget() method from KNewStuff (introduced in Frameworks 5.37).
This commit is contained in:
parent
aa771da32d
commit
69c3eba0ad
|
@ -27,7 +27,7 @@
|
|||
#include <KLocalizedString>
|
||||
#include <KNS3/KMoreToolsMenuFactory>
|
||||
#include <KIO/Job>
|
||||
|
||||
#include <knewstuff_version.h>
|
||||
|
||||
StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) :
|
||||
KCapacityBar(KCapacityBar::DrawTextInline, parent),
|
||||
|
@ -78,6 +78,9 @@ void StatusBarSpaceInfo::mousePressEvent(QMouseEvent* event)
|
|||
// Note that this object must live long enough in case the user opens
|
||||
// the "Configure..." dialog
|
||||
KMoreToolsMenuFactory menuFactory(QStringLiteral("dolphin/statusbar-diskspace-menu"));
|
||||
#if KNEWSTUFF_VERSION >= QT_VERSION_CHECK(5, 37, 0)
|
||||
menuFactory.setParentWidget(this);
|
||||
#endif
|
||||
auto menu = menuFactory.createMenuFromGroupingNames(
|
||||
{ "disk-usage", "more:", "disk-partitions" }, m_url);
|
||||
|
||||
|
|
Loading…
Reference in a new issue