2024-06-30 12:51:22 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <KActionMenu>
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
|
|
class LexerGroupActionMenu : public KActionMenu
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-07-02 23:47:26 +08:00
|
|
|
LexerGroupActionMenu(const QString &text, QChar grp, QObject *parent)
|
2024-06-30 12:51:22 +08:00
|
|
|
: KActionMenu(text, parent)
|
|
|
|
{
|
|
|
|
m_group = nullptr;
|
2024-07-02 23:47:26 +08:00
|
|
|
m_languageGroup = grp.toLower();
|
2024-06-30 12:51:22 +08:00
|
|
|
connect(menu(), &QMenu::aboutToShow, this, &LexerGroupActionMenu::slotAboutToShow);
|
|
|
|
setPopupMode(QToolButton::InstantPopup);
|
|
|
|
}
|
|
|
|
|
2024-07-02 23:47:26 +08:00
|
|
|
static std::list<QChar> groups();
|
|
|
|
static QString displayName(const QString & lexerName);
|
2024-06-30 12:51:22 +08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void lexerSelected(const QString lexerName);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QActionGroup *m_group;
|
2024-07-02 23:47:26 +08:00
|
|
|
QChar m_languageGroup;
|
2024-06-30 12:51:22 +08:00
|
|
|
|
|
|
|
public:
|
|
|
|
void slotAboutToShow();
|
|
|
|
};
|