]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/zoomwidgetaction.h
Combine the zoom menu entries into one Line
[dolphin.git] / src / views / zoomwidgetaction.h
1 /*
2 * SPDX-FileCopyrightText: 2025 Gleb Kasachou <gkosachov99@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef ZOOM_WIDGET_ACTION_H
8 #define ZOOM_WIDGET_ACTION_H
9
10 #include <KToolBarPopupAction>
11
12 /**
13 * This WidgetAction combines the three zoom actions into one line.
14 *
15 * This requires less space, logically groups these actions, and keeps the menu open when the user uses the buttons.
16 */
17
18 class ZoomWidgetAction : public KToolBarPopupAction
19 {
20 public:
21 ZoomWidgetAction(QAction *zoomInAction, QAction *zoomResetAction, QAction *zoomOutAction, QObject *parent);
22
23 protected:
24 QWidget *createWidget(QWidget *parent) override;
25 bool eventFilter(QObject *object, QEvent *event) override;
26
27 private:
28 QAction *m_zoomInAction;
29 QAction *m_zoomResetAction;
30 QAction *m_zoomOutAction;
31 };
32
33 #endif