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"
|
2021-06-19 22:58:35 +08:00
|
|
|
#include "../colorscheme.h"
|
|
|
|
|
2021-06-20 14:30:47 +08:00
|
|
|
#include <QMenu>
|
2021-06-19 22:58:35 +08:00
|
|
|
#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:
|
2021-06-19 22:58:35 +08:00
|
|
|
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();
|
|
|
|
|
2021-06-19 22:58:35 +08:00
|
|
|
public slots:
|
|
|
|
void onItemSelectionChanged();
|
|
|
|
void onSettingChanged();
|
|
|
|
void onForegroundChanged();
|
|
|
|
void onBackgroundChanged();
|
|
|
|
void onFontStyleChanged();
|
2021-06-20 14:30:47 +08:00
|
|
|
void changeSchemeComboFont();
|
2021-06-19 22:58:35 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void addDefine(const QString& name, PColorSchemeItemDefine define);
|
|
|
|
PColorSchemeItem getCurrentItem();
|
2021-06-20 09:27:37 +08:00
|
|
|
PColorScheme getCurrentScheme();
|
2021-06-20 14:30:47 +08:00
|
|
|
void connectModificationSlots();
|
|
|
|
void disconnectModificationSlots();
|
|
|
|
void setCurrentSchemeModified();
|
2021-06-19 22:58:35 +08:00
|
|
|
|
2021-06-14 08:01:00 +08:00
|
|
|
private:
|
|
|
|
Ui::EditorColorSchemeWidget *ui;
|
2021-06-19 22:58:35 +08:00
|
|
|
QStandardItemModel mDefinesModel;
|
2021-06-20 14:30:47 +08:00
|
|
|
QFont mDefaultSchemeComboFont;
|
|
|
|
QFont mModifiedSchemeComboFont;
|
|
|
|
QSet<QString> mModifiedSchemes;
|
|
|
|
QMenu mMenu;
|
2021-06-17 10:39:46 +08:00
|
|
|
|
|
|
|
// SettingsWidget interface
|
|
|
|
protected:
|
|
|
|
void doLoad() override;
|
|
|
|
void doSave() override;
|
2021-06-19 22:58:35 +08:00
|
|
|
|
2021-06-20 14:30:47 +08:00
|
|
|
private slots:
|
|
|
|
void on_actionCopy_Scheme_triggered();
|
|
|
|
void on_btnSchemeMenu_pressed();
|
2021-06-20 22:54:16 +08:00
|
|
|
void on_actionImport_Scheme_triggered();
|
|
|
|
void on_actionRename_Scheme_triggered();
|
|
|
|
void on_actionReset_Scheme_triggered();
|
|
|
|
void on_actionExport_Scheme_triggered();
|
|
|
|
void on_actionDelete_Scheme_triggered();
|
2021-06-14 08:01:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // EDITORCOLORSCHEMEWIDGET_H
|