diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/settings/FontColorSettingsDialog.h |
Diffstat (limited to 'src/settings/FontColorSettingsDialog.h')
-rw-r--r-- | src/settings/FontColorSettingsDialog.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/settings/FontColorSettingsDialog.h b/src/settings/FontColorSettingsDialog.h new file mode 100644 index 0000000..273f61c --- /dev/null +++ b/src/settings/FontColorSettingsDialog.h @@ -0,0 +1,71 @@ +#ifndef FONTCOLORSETTINGSDIALOG_H +#define FONTCOLORSETTINGSDIALOG_H + +#include "../field-styles/FieldStyleFactory.h" + +#include <QtWidgets> + +class ColorBox; + +class FontColorSettingsDialog : public QDialog +{ + Q_OBJECT + +public: + FontColorSettingsDialog(QWidget *parent = 0); + ~FontColorSettingsDialog(); + + const FieldStyleFactory* styleFactory() const { return m_styleFactory; } + +private: + void initData(); + QHBoxLayout* createBgColorSelector(); + QLabel* createStylesList(); + QPushButton* createRestoreButton(); + QVBoxLayout* createStyleControls(); + void createKeywordBox( QVBoxLayout* aStyleLt ); + QLabel* createStylePreview(); + void updatePreview(); + +private slots: + void updateStyleControls( const QModelIndex& aIndex ); + void setBgColor(QColor aColor); + void setFontFamily(QFont aFont); + void setFontSize(int aSize); + void setBoldFont(int aState); + void setItalicFont(int aState); + void setStyleColor(QColor aColor); + void setPrefix(const QString aText); + void setSuffix(const QString aText); + void setKeywordStyle(bool aNewKeywordStyleState); + void setKeywordBoldFont(int aState); + void setKeywordItalicFont(int aState); + void setKeywordColor(QColor aColor); + void dialogButtonClicked( QAbstractButton* aButton ); + +private: + static const int StyleListMaxWidth = 150; + static const int SizeSelectorMaxWidth = 50; + static const int StyleEditMaxWidth = 40; + + FieldStyleFactory* m_styleFactory; + FieldStyle* m_curStyle; + + ColorBox* m_bgColorSelector; + QListView* m_stylesListView; + QFontComboBox* m_fontSelector; + QSpinBox* m_sizeSelector; + QCheckBox* m_boldCB; + QCheckBox* m_italicCB; + ColorBox* m_fontColorSelector; + QLineEdit* m_prefixEdit; + QLineEdit* m_suffixEdit; + QGroupBox* m_keywordBox; + QCheckBox* m_keywordBoldCB; + QCheckBox* m_keywordItalicCB; + ColorBox* m_keywordColorSelector; + QTableView* m_stylesPreview; + QDialogButtonBox* m_okCancelBox; +}; + +#endif |