-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreferencesDialog.h
More file actions
100 lines (70 loc) · 2.2 KB
/
PreferencesDialog.h
File metadata and controls
100 lines (70 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef OPENNOTE_LINUX_PREFERENCESDIALOG_H
#define OPENNOTE_LINUX_PREFERENCESDIALOG_H
#pragma once
#include <QCheckBox>
#include <QComboBox>
#include <QDialog>
#include <QLabel>
#include <QListWidget>
#include <QPlainTextEdit>
#include <QPushButton>
#include <QSpinBox>
#include <QTabWidget>
#include "AppDatabase.h"
#include "SyntaxTheme.h"
class SyntaxHighlighter;
class PreferencesDialog : public QDialog {
Q_OBJECT
public:
explicit PreferencesDialog(QWidget* parent = nullptr);
signals :
void settingsChanged(); // emitted when OK or Apply is clicked
private
slots :
void apply();
void onTokenSelected(int row);
void onColorButtonClicked();
void onDefaultColorButtonClicked();
void onBoldToggled(bool on);
void onItalicToggled(bool on);
void onThemeChanged(int index);
void onPreviewModeChanged(int index);
private:
void setupUi();
QWidget* buildViewTab();
QWidget* buildEditorTab();
QWidget* buildSyntaxHighlightingTab();
void loadFromDatabase();
void saveToDatabase();
void refreshPreview();
void updateColorButton();
QTabWidget* m_tabs = nullptr;
// View tab
QCheckBox* m_showLineNumbers = nullptr;
QCheckBox* m_highlightCurrentLine = nullptr;
QCheckBox* m_showStatusBar = nullptr;
QCheckBox* m_wordWrap = nullptr;
QCheckBox* m_wrapAtWord = nullptr;
// Editor tab
QSpinBox* m_tabSize = nullptr;
QCheckBox* m_spacesInsteadOfTabs = nullptr;
QCheckBox* m_autoIndent = nullptr;
QCheckBox* m_openRecentFiles = nullptr;
QCheckBox* m_autoSave = nullptr;
QSpinBox* m_autoSaveInterval = nullptr;
// Font & Colors tab
QListWidget* m_tokenList = nullptr;
QPushButton* m_colorBtn = nullptr;
QPushButton* m_defaultColorBtn = nullptr;
QCheckBox* m_boldChk = nullptr;
QCheckBox* m_italicChk = nullptr;
QPlainTextEdit* m_preview = nullptr;
SyntaxHighlighter* m_highlighter = nullptr;
QComboBox* m_themeCombo = nullptr;
QComboBox* m_previewModeCombo = nullptr;
// Working copy of the theme being edited
SyntaxTheme m_editTheme;
QString m_currentToken;
bool m_loadingTheme = false;
};
#endif // OPENNOTE_LINUX_PREFERENCESDIALOG_H