annotate include/gui/widgets/text.h @ 67:442065432549

poster: make posters link to AniList
author Paper <mrpapersonic@gmail.com>
date Mon, 02 Oct 2023 07:06:44 -0400
parents fe719c109dbc
children 27a19dd6cba1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #ifndef __gui__ui_utils_h
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #define __gui__ui_utils_h
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
3
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <QFrame>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <QLabel>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 #include <QPlainTextEdit>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include <QSize>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 #include <QString>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 #include <QWidget>
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
10
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 namespace TextWidgets {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 class Header : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17 Header(QString title, QWidget* parent = nullptr);
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
18 void SetText(QString title);
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 QLabel* static_text_title;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 QFrame* static_text_line;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 class Paragraph : public QPlainTextEdit {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29 Paragraph(QString text, QWidget* parent = nullptr);
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
30 void SetText(QString text);
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
31 QSize minimumSizeHint() const override;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
32 QSize sizeHint() const override;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35 /* technically a paragraph and a heading is actually a
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36 "section", but that name is equally as confusing as
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37 "text paragraph". */
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38 class TextParagraph : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
41 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
42 TextParagraph(QString title, QString data, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43 Header* GetHeader();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
44 Paragraph* GetParagraph();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
45
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47 Header* header;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48 Paragraph* paragraph;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51 class LabelledTextParagraph : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 LabelledTextParagraph(QString title, QString label, QString data, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 Header* GetHeader();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57 Paragraph* GetLabels();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 Paragraph* GetParagraph();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
59
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61 Header* header;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
62 Paragraph* labels;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
63 Paragraph* paragraph;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
64 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
65
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
66 class SelectableTextParagraph : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
67 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
68
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
70 SelectableTextParagraph(QString title, QString data, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
71 Header* GetHeader();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
72 Paragraph* GetParagraph();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
73
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
74 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
75 Header* header;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
76 Paragraph* paragraph;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
77 };
64
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
78
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
79 class Title : public Paragraph {
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
80 Q_OBJECT
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
81
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
82 public:
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
83 Title(QString title, QWidget* parent = nullptr);
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
84 };
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
85
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
86 } // namespace TextWidgets
fe719c109dbc *: update
Paper <mrpapersonic@gmail.com>
parents: 63
diff changeset
87
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
88 #endif // __gui__ui_utils_h