┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/zoomwidgetaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/zoomwidgetaction.h')
-rw-r--r--src/views/zoomwidgetaction.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/views/zoomwidgetaction.h b/src/views/zoomwidgetaction.h
new file mode 100644
index 000000000..b55f5e25c
--- /dev/null
+++ b/src/views/zoomwidgetaction.h
@@ -0,0 +1,33 @@
+/*
+ * SPDX-FileCopyrightText: 2025 Gleb Kasachou <[email protected]>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef ZOOM_WIDGET_ACTION_H
+#define ZOOM_WIDGET_ACTION_H
+
+#include <KToolBarPopupAction>
+
+/**
+ * This WidgetAction combines the three zoom actions into one line.
+ *
+ * This requires less space, logically groups these actions, and keeps the menu open when the user uses the buttons.
+ */
+
+class ZoomWidgetAction : public KToolBarPopupAction
+{
+public:
+ ZoomWidgetAction(QAction *zoomInAction, QAction *zoomResetAction, QAction *zoomOutAction, QObject *parent);
+
+protected:
+ QWidget *createWidget(QWidget *parent) override;
+ bool eventFilter(QObject *object, QEvent *event) override;
+
+private:
+ QAction *m_zoomInAction;
+ QAction *m_zoomResetAction;
+ QAction *m_zoomOutAction;
+};
+
+#endif