46
|
1 #ifndef __gui__ui_utils_h
|
|
2 #define __gui__ui_utils_h
|
64
|
3
|
69
|
4 #include <QWidget>
|
|
5 #include <QString>
|
|
6 #include <QSize>
|
46
|
7 #include <QPlainTextEdit>
|
75
|
8 #include <QLineEdit>
|
69
|
9
|
|
10 class QFrame;
|
|
11 class QLabel;
|
64
|
12
|
46
|
13 namespace TextWidgets {
|
|
14
|
|
15 class Header : public QWidget {
|
|
16 Q_OBJECT
|
|
17
|
|
18 public:
|
|
19 Header(QString title, QWidget* parent = nullptr);
|
64
|
20 void SetText(QString title);
|
46
|
21
|
|
22 private:
|
|
23 QLabel* static_text_title;
|
|
24 QFrame* static_text_line;
|
|
25 };
|
|
26
|
|
27 class Paragraph : public QPlainTextEdit {
|
|
28 Q_OBJECT
|
|
29
|
|
30 public:
|
|
31 Paragraph(QString text, QWidget* parent = nullptr);
|
64
|
32 void SetText(QString text);
|
46
|
33 QSize minimumSizeHint() const override;
|
|
34 QSize sizeHint() const override;
|
|
35 };
|
|
36
|
75
|
37 class Line : public QLineEdit {
|
46
|
38 Q_OBJECT
|
|
39
|
|
40 public:
|
75
|
41 Line(QString text, QWidget* parent = nullptr);
|
|
42 };
|
|
43
|
|
44 class Title : public Line {
|
|
45 Q_OBJECT
|
|
46
|
|
47 public:
|
|
48 Title(QString title, QWidget* parent = nullptr);
|
|
49 };
|
|
50
|
|
51 class Section : public QWidget {
|
|
52 Q_OBJECT
|
|
53
|
|
54 public:
|
|
55 Section(QString title, QString data, QWidget* parent = nullptr);
|
46
|
56 Header* GetHeader();
|
|
57 Paragraph* GetParagraph();
|
|
58
|
|
59 private:
|
|
60 Header* header;
|
|
61 Paragraph* paragraph;
|
|
62 };
|
|
63
|
75
|
64 class LabelledSection : public QWidget {
|
46
|
65 Q_OBJECT
|
|
66
|
|
67 public:
|
75
|
68 LabelledSection(QString title, QString label, QString data, QWidget* parent = nullptr);
|
46
|
69 Header* GetHeader();
|
|
70 Paragraph* GetLabels();
|
|
71 Paragraph* GetParagraph();
|
|
72
|
|
73 private:
|
|
74 Header* header;
|
|
75 Paragraph* labels;
|
|
76 Paragraph* paragraph;
|
|
77 };
|
|
78
|
75
|
79 class SelectableSection : public QWidget {
|
46
|
80 Q_OBJECT
|
|
81
|
|
82 public:
|
75
|
83 SelectableSection(QString title, QString data, QWidget* parent = nullptr);
|
46
|
84 Header* GetHeader();
|
|
85 Paragraph* GetParagraph();
|
|
86
|
|
87 private:
|
|
88 Header* header;
|
|
89 Paragraph* paragraph;
|
|
90 };
|
64
|
91
|
75
|
92 class OneLineSection : public QWidget {
|
64
|
93 Q_OBJECT
|
|
94
|
|
95 public:
|
75
|
96 OneLineSection(QString title, QString data, QWidget* parent = nullptr);
|
|
97 Header* GetHeader();
|
|
98 Line* GetLine();
|
|
99
|
|
100 private:
|
|
101 Header* header;
|
|
102 Line* line;
|
64
|
103 };
|
|
104
|
|
105 } // namespace TextWidgets
|
|
106
|
46
|
107 #endif // __gui__ui_utils_h
|