RedPanda-CPP/RedPandaIDE/settingsdialog/editorcolorschemewidget.h

47 lines
997 B
C
Raw Normal View History

2021-06-14 08:01:00 +08:00
#ifndef EDITORCOLORSCHEMEWIDGET_H
#define EDITORCOLORSCHEMEWIDGET_H
2021-06-17 10:39:46 +08:00
#include "settingswidget.h"
#include "../colorscheme.h"
#include <QStandardItemModel>
2021-06-14 08:01:00 +08:00
namespace Ui {
class EditorColorSchemeWidget;
}
2021-06-17 10:39:46 +08:00
class EditorColorSchemeWidget : public SettingsWidget
2021-06-14 08:01:00 +08:00
{
Q_OBJECT
public:
enum {
NameRole = Qt::UserRole+1
};
2021-06-17 10:39:46 +08:00
explicit EditorColorSchemeWidget(const QString& name, const QString& group, QWidget *parent = nullptr);
2021-06-14 08:01:00 +08:00
~EditorColorSchemeWidget();
public slots:
void onItemSelectionChanged();
void onSettingChanged();
void onForegroundChanged();
void onBackgroundChanged();
void onFontStyleChanged();
private:
void addDefine(const QString& name, PColorSchemeItemDefine define);
PColorSchemeItem getCurrentItem();
2021-06-14 08:01:00 +08:00
private:
Ui::EditorColorSchemeWidget *ui;
QStandardItemModel mDefinesModel;
2021-06-17 10:39:46 +08:00
// SettingsWidget interface
protected:
void doLoad() override;
void doSave() override;
2021-06-14 08:01:00 +08:00
};
#endif // EDITORCOLORSCHEMEWIDGET_H