summaryrefslogtreecommitdiff
path: root/src/settings/FontColorSettingsDialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/FontColorSettingsDialog.h')
-rw-r--r--src/settings/FontColorSettingsDialog.h71
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