File indexing completed on 2024-04-28 17:06:04
0001 /* 0002 SPDX-FileCopyrightText: 2006 Václav Juza <vaclavjuza@gmail.com> 0003 SPDX-FileCopyrightText: 2006-2022 Krusader Krew <https://krusader.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef KCMDMODEBUTTON_H 0009 #define KCMDMODEBUTTON_H 0010 0011 // QtWidgets 0012 #include <QToolButton> 0013 0014 class KActionMenu; 0015 0016 /** 0017 * represents a button for switching the command-line execution mode 0018 * It extends QToolButton, set the icon etc., and creates a popup menu 0019 * containing the actions to actually switch the mode. 0020 */ 0021 class KCMDModeButton : public QToolButton 0022 { 0023 Q_OBJECT 0024 public: 0025 /** Constructor. Sets up the menu, and the icon */ 0026 explicit KCMDModeButton(QWidget *parent = nullptr); 0027 ~KCMDModeButton() override; 0028 0029 /** Shows the popup menu. Called when clicked to the button */ 0030 void showMenu(); 0031 0032 private: 0033 /** The menu containing the actions for switching the mode */ 0034 KActionMenu *action; 0035 }; 0036 0037 #endif