File indexing completed on 2024-05-19 04:29:52

0001 /*
0002  *  SPDX-FileCopyrightText: 2023 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 #ifndef KISMENUSTYLEDONTCLOSEONALT_H
0007 #define KISMENUSTYLEDONTCLOSEONALT_H
0008 
0009 #include "kritawidgetutils_export.h"
0010 #include <QProxyStyle>
0011 
0012 
0013 /**
0014  * A special proxy style for menus that have an input box for non-numeric
0015  * text inside. Some languages require AltGr for typing special symbols,
0016  * so we need to ensure that the menu is not closed when that key is
0017  * pressed.
0018  */
0019 class KRITAWIDGETUTILS_EXPORT KisMenuStyleDontCloseOnAlt : public QProxyStyle
0020 {
0021 public:
0022     KisMenuStyleDontCloseOnAlt(QStyle *baseStyle);
0023     int styleHint(QStyle::StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const override;
0024 };
0025 
0026 #endif // KISMENUSTYLEDONTCLOSEONALT_H