annotate include/gui/widgets/text.h @ 46:d0adc4aedfc8

*: update... this commit: 1. consolidates dark theme stuff to dark_theme.cpp 2. creates a new widgets folder to store all of our custom widgets 3. creates the list settings page in the information dialog, although much of it is nonfunctional: it doesn't save, and the status doesn't even get filled in... we'll fix this later!
author Paper <mrpapersonic@gmail.com>
date Sat, 23 Sep 2023 01:02:15 -0400
parents
children 3d2decf093bb
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
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 #include <QFrame>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <QLabel>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <QPlainTextEdit>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 #include <QSize>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include <QString>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 #include <QWidget>
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 namespace TextWidgets {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 void SetPlainTextEditData(QPlainTextEdit* text_edit, QString data);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 class Header : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 Header(QString title, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17 void SetTitle(QString title);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 QLabel* static_text_title;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 QFrame* static_text_line;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 class Paragraph : public QPlainTextEdit {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28 Paragraph(QString text, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29 QSize minimumSizeHint() const override;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
30 QSize sizeHint() const override;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
31 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
32
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 /* technically a paragraph and a heading is actually a
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34 "section", but that name is equally as confusing as
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35 "text paragraph". */
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36 class TextParagraph : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40 TextParagraph(QString title, QString data, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
41 Header* GetHeader();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
42 Paragraph* GetParagraph();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
44 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
45 Header* header;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 Paragraph* paragraph;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 class LabelledTextParagraph : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53 LabelledTextParagraph(QString title, QString label, QString data, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 Header* GetHeader();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 Paragraph* GetLabels();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 Paragraph* GetParagraph();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
59 Header* header;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60 Paragraph* labels;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61 Paragraph* paragraph;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
62 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
63
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
64 class SelectableTextParagraph : public QWidget {
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
65 Q_OBJECT
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
66
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
67 public:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
68 SelectableTextParagraph(QString title, QString data, QWidget* parent = nullptr);
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69 Header* GetHeader();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
70 Paragraph* GetParagraph();
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
71
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
72 private:
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
73 Header* header;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
74 Paragraph* paragraph;
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
75 };
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
76 }; // namespace UiUtils
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
77 #endif // __gui__ui_utils_h