From 980b09b92ae3061006526293c1e64bc399cdc07b Mon Sep 17 00:00:00 2001 From: Méven Car Date: Fri, 24 Apr 2026 19:12:01 +0200 Subject: zoomwidgetactions: allow the zoom actions to appear in the commandbar kxmlgui KCommandBar uses QAction::menu() to construct its action list. Reuse the popupMenu as the menu, so KCommandbar finds zoom actions. --- src/views/zoomwidgetaction.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/views') diff --git a/src/views/zoomwidgetaction.cpp b/src/views/zoomwidgetaction.cpp index 431ac4f62..2260d9754 100644 --- a/src/views/zoomwidgetaction.cpp +++ b/src/views/zoomwidgetaction.cpp @@ -61,9 +61,13 @@ ZoomWidgetAction::ZoomWidgetAction(QAction *zoomInAction, QAction *zoomResetActi { // This is a property that KXMLGui reads to determine whether this action // should be included in the shortcut configuration UI + // they are already added to the action collection setProperty("isShortcutConfigurable", false); setPopupMode(InstantPopup); popupMenu()->addActions({zoomInAction, zoomResetAction, zoomOutAction}); + + // but this should be accessible through command bar + setMenu(popupMenu()); } bool ZoomWidgetAction::eventFilter(QObject *object, QEvent *event) -- cgit v1.3