Mercurial > minori
annotate include/gui/widgets/text.h @ 253:b3549da699a6
*: ooooh! stupid big commit!
oops
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 06 Feb 2024 16:56:32 -0500 |
parents | 8043152ef9d4 |
children | 862d0d8619f6 |
rev | line source |
---|---|
46 | 1 #ifndef __gui__ui_utils_h |
2 #define __gui__ui_utils_h | |
64 | 3 |
76 | 4 #include <QLineEdit> |
5 #include <QPlainTextEdit> | |
69 | 6 #include <QSize> |
76 | 7 #include <QString> |
8 #include <QWidget> | |
69 | 9 |
10 class QFrame; | |
253 | 11 |
12 #include <QLabel> | |
64 | 13 |
46 | 14 namespace TextWidgets { |
15 | |
16 class Header : public QWidget { | |
17 Q_OBJECT | |
18 | |
19 public: | |
83 | 20 Header(const QString& title, QWidget* parent = nullptr); |
21 void SetText(const QString& title); | |
46 | 22 |
23 private: | |
24 QLabel* static_text_title; | |
25 QFrame* static_text_line; | |
26 }; | |
27 | |
253 | 28 class Paragraph : public QLabel { |
29 Q_OBJECT | |
46 | 30 |
253 | 31 public: |
32 Paragraph(const QString& text, QWidget* parent = nullptr); | |
33 void SetText(const QString& text); | |
46 | 34 }; |
35 | |
253 | 36 class LabelledParagraph final : public QWidget { |
37 Q_OBJECT | |
38 | |
39 public: | |
40 LabelledParagraph(const QString& label, const QString& data, QWidget* parent = nullptr); | |
41 Paragraph* GetLabels(); | |
42 Paragraph* GetParagraph(); | |
46 | 43 |
253 | 44 private: |
45 Paragraph* labels; | |
46 Paragraph* paragraph; | |
47 }; | |
48 | |
49 class Line : public Paragraph { | |
50 Q_OBJECT | |
51 | |
52 public: | |
53 Line(QWidget* parent = nullptr); | |
54 Line(const QString& text, QWidget* parent = nullptr); | |
55 void SetText(const QString& text); | |
75 | 56 }; |
57 | |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
83
diff
changeset
|
58 class Title final : public Line { |
75 | 59 Q_OBJECT |
60 | |
61 public: | |
83 | 62 Title(const QString& title, QWidget* parent = nullptr); |
75 | 63 }; |
64 | |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
83
diff
changeset
|
65 class Section final : public QWidget { |
75 | 66 Q_OBJECT |
67 | |
68 public: | |
83 | 69 Section(const QString& title, const QString& data, QWidget* parent = nullptr); |
46 | 70 Header* GetHeader(); |
71 Paragraph* GetParagraph(); | |
72 | |
73 private: | |
74 Header* header; | |
75 Paragraph* paragraph; | |
76 }; | |
77 | |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
83
diff
changeset
|
78 class LabelledSection final : public QWidget { |
46 | 79 Q_OBJECT |
80 | |
81 public: | |
83 | 82 LabelledSection(const QString& title, const QString& label, const QString& data, QWidget* parent = nullptr); |
46 | 83 Header* GetHeader(); |
84 Paragraph* GetLabels(); | |
85 Paragraph* GetParagraph(); | |
86 | |
87 private: | |
88 Header* header; | |
253 | 89 LabelledParagraph* content; |
46 | 90 }; |
91 | |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
83
diff
changeset
|
92 class SelectableSection final : public QWidget { |
46 | 93 Q_OBJECT |
94 | |
95 public: | |
83 | 96 SelectableSection(const QString& title, const QString& data, QWidget* parent = nullptr); |
46 | 97 Header* GetHeader(); |
98 Paragraph* GetParagraph(); | |
99 | |
100 private: | |
101 Header* header; | |
102 Paragraph* paragraph; | |
103 }; | |
64 | 104 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
83
diff
changeset
|
105 class OneLineSection final : public QWidget { |
64 | 106 Q_OBJECT |
107 | |
108 public: | |
83 | 109 OneLineSection(const QString& title, const QString& data, QWidget* parent = nullptr); |
75 | 110 Header* GetHeader(); |
111 Line* GetLine(); | |
112 | |
113 private: | |
114 Header* header; | |
115 Line* line; | |
64 | 116 }; |
117 | |
118 } // namespace TextWidgets | |
119 | |
46 | 120 #endif // __gui__ui_utils_h |