From 5d251b725b7f443f33e4ae45732514a2f8a9c3c7 Mon Sep 17 00:00:00 2001 From: Simone Gaiarin Date: Sun, 18 Apr 2021 15:53:49 +0200 Subject: [PATCH] Use new ToggleActionMenu constructor interface --- part/annotationactionhandler.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/part/annotationactionhandler.cpp b/part/annotationactionhandler.cpp index 62f4e8372..d0f2be7a8 100644 --- a/part/annotationactionhandler.cpp +++ b/part/annotationactionhandler.cpp @@ -650,7 +650,14 @@ AnnotationActionHandler::AnnotationActionHandler(PageViewAnnotator *parent, KAct connect(d->aStamp->menu(), &QMenu::triggered, d->aStamp, &ToggleActionMenu::setDefaultAction); // Quick annotations action - d->aQuickTools = new ToggleActionMenu(QIcon::fromTheme(QStringLiteral("draw-freehand")), i18nc("@action:intoolbar Show list of quick annotation tools", "Quick Annotations"), this, ToggleActionMenu::MenuButtonPopup); + d->aQuickTools = new ToggleActionMenu(i18nc("@action:intoolbar Show list of quick annotation tools", "Quick Annotations"), this); +#if KWIDGETSADDONS_VERSION < QT_VERSION_CHECK(5, 77, 0) + d->aQuickTools->setDelayed(false); + d->aQuickTools->setStickyMenu(false); +#else + d->aQuickTools->setPopupMode(QToolButton::MenuButtonPopup); +#endif + d->aQuickTools->setIcon(QIcon::fromTheme(QStringLiteral("draw-freehand"))); d->aQuickTools->setToolTip(i18nc("@info:tooltip", "Choose an annotation tool from the quick annotations")); d->aQuickTools->setEnabled(true); // required to ensure that populateQuickAnnotations is executed the first time // set the triggered quick annotation as default action (but avoid setting 'Configure...' as default action)