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>
|
69
|
8
|
|
9 class QFrame;
|
|
10 class QLabel;
|
64
|
11
|
46
|
12 namespace TextWidgets {
|
|
13
|
|
14 class Header : public QWidget {
|
|
15 Q_OBJECT
|
|
16
|
|
17 public:
|
|
18 Header(QString title, QWidget* parent = nullptr);
|
64
|
19 void SetText(QString title);
|
46
|
20
|
|
21 private:
|
|
22 QLabel* static_text_title;
|
|
23 QFrame* static_text_line;
|
|
24 };
|
|
25
|
|
26 class Paragraph : public QPlainTextEdit {
|
|
27 Q_OBJECT
|
|
28
|
|
29 public:
|
|
30 Paragraph(QString text, QWidget* parent = nullptr);
|
64
|
31 void SetText(QString text);
|
46
|
32 QSize minimumSizeHint() const override;
|
|
33 QSize sizeHint() const override;
|
|
34 };
|
|
35
|
|
36 /* technically a paragraph and a heading is actually a
|
|
37 "section", but that name is equally as confusing as
|
|
38 "text paragraph". */
|
|
39 class TextParagraph : public QWidget {
|
|
40 Q_OBJECT
|
|
41
|
|
42 public:
|
|
43 TextParagraph(QString title, QString data, QWidget* parent = nullptr);
|
|
44 Header* GetHeader();
|
|
45 Paragraph* GetParagraph();
|
|
46
|
|
47 private:
|
|
48 Header* header;
|
|
49 Paragraph* paragraph;
|
|
50 };
|
|
51
|
|
52 class LabelledTextParagraph : public QWidget {
|
|
53 Q_OBJECT
|
|
54
|
|
55 public:
|
|
56 LabelledTextParagraph(QString title, QString label, QString data, QWidget* parent = nullptr);
|
|
57 Header* GetHeader();
|
|
58 Paragraph* GetLabels();
|
|
59 Paragraph* GetParagraph();
|
|
60
|
|
61 private:
|
|
62 Header* header;
|
|
63 Paragraph* labels;
|
|
64 Paragraph* paragraph;
|
|
65 };
|
|
66
|
|
67 class SelectableTextParagraph : public QWidget {
|
|
68 Q_OBJECT
|
|
69
|
|
70 public:
|
|
71 SelectableTextParagraph(QString title, QString data, QWidget* parent = nullptr);
|
|
72 Header* GetHeader();
|
|
73 Paragraph* GetParagraph();
|
|
74
|
|
75 private:
|
|
76 Header* header;
|
|
77 Paragraph* paragraph;
|
|
78 };
|
64
|
79
|
|
80 class Title : public Paragraph {
|
|
81 Q_OBJECT
|
|
82
|
|
83 public:
|
|
84 Title(QString title, QWidget* parent = nullptr);
|
|
85 };
|
|
86
|
|
87 } // namespace TextWidgets
|
|
88
|
46
|
89 #endif // __gui__ui_utils_h
|