comparison include/gui/widgets/text.h @ 258:862d0d8619f6

*: HUUUGE changes animia has been renamed to animone, so instead of thinking of a health condition, you think of a beautiful flower :) I've also edited some of the code for animone, but I have no idea if it even works or not because I don't have a mac or windows machine lying around. whoops! ... anyway, all of the changes divergent from Anisthesia are now licensed under BSD. it's possible that I could even rewrite most of the code to where I don't even have to keep the MIT license, but that's thinking too far into the future I've been slacking off on implementing the anime seasons page, mostly out of laziness. I think I'd have to create another db file specifically for the seasons anyway, this code is being pushed *primarily* because the hard drive it's on is failing! yay :)
author Paper <paper@paper.us.eu.org>
date Mon, 01 Apr 2024 02:43:44 -0400
parents b3549da699a6
children 3ec7804abf17
comparison
equal deleted inserted replaced
257:699a20c57dc8 258:862d0d8619f6
12 #include <QLabel> 12 #include <QLabel>
13 13
14 namespace TextWidgets { 14 namespace TextWidgets {
15 15
16 class Header : public QWidget { 16 class Header : public QWidget {
17 Q_OBJECT 17 Q_OBJECT
18 18
19 public: 19 public:
20 Header(const QString& title, QWidget* parent = nullptr); 20 Header(const QString& title, QWidget* parent = nullptr);
21 void SetText(const QString& title); 21 void SetText(const QString& title);
22 22
23 private: 23 private:
24 QLabel* static_text_title; 24 QLabel* static_text_title;
25 QFrame* static_text_line; 25 QFrame* static_text_line;
26 }; 26 };
27 27
28 class Paragraph : public QLabel { 28 class Paragraph : public QLabel {
29 Q_OBJECT 29 Q_OBJECT
30 30
54 Line(const QString& text, QWidget* parent = nullptr); 54 Line(const QString& text, QWidget* parent = nullptr);
55 void SetText(const QString& text); 55 void SetText(const QString& text);
56 }; 56 };
57 57
58 class Title final : public Line { 58 class Title final : public Line {
59 Q_OBJECT 59 Q_OBJECT
60 60
61 public: 61 public:
62 Title(const QString& title, QWidget* parent = nullptr); 62 Title(const QString& title, QWidget* parent = nullptr);
63 }; 63 };
64 64
65 class Section final : public QWidget { 65 class Section final : public QWidget {
66 Q_OBJECT 66 Q_OBJECT
67 67
68 public: 68 public:
69 Section(const QString& title, const QString& data, QWidget* parent = nullptr); 69 Section(const QString& title, const QString& data, QWidget* parent = nullptr);
70 Header* GetHeader(); 70 Header* GetHeader();
71 Paragraph* GetParagraph(); 71 Paragraph* GetParagraph();
72 72
73 private: 73 private:
74 Header* header; 74 Header* header;
75 Paragraph* paragraph; 75 Paragraph* paragraph;
76 }; 76 };
77 77
78 class LabelledSection final : public QWidget { 78 class LabelledSection final : public QWidget {
79 Q_OBJECT 79 Q_OBJECT
80 80
81 public: 81 public:
82 LabelledSection(const QString& title, const QString& label, const QString& data, QWidget* parent = nullptr); 82 LabelledSection(const QString& title, const QString& label, const QString& data, QWidget* parent = nullptr);
83 Header* GetHeader(); 83 Header* GetHeader();
84 Paragraph* GetLabels(); 84 Paragraph* GetLabels();
85 Paragraph* GetParagraph(); 85 Paragraph* GetParagraph();
86 86
87 private: 87 private:
88 Header* header; 88 Header* header;
89 LabelledParagraph* content; 89 LabelledParagraph* content;
90 }; 90 };
91 91
92 class SelectableSection final : public QWidget { 92 class SelectableSection final : public QWidget {
93 Q_OBJECT 93 Q_OBJECT
94 94
95 public: 95 public:
96 SelectableSection(const QString& title, const QString& data, QWidget* parent = nullptr); 96 SelectableSection(const QString& title, const QString& data, QWidget* parent = nullptr);
97 Header* GetHeader(); 97 Header* GetHeader();
98 Paragraph* GetParagraph(); 98 Paragraph* GetParagraph();
99 99
100 private: 100 private:
101 Header* header; 101 Header* header;
102 Paragraph* paragraph; 102 Paragraph* paragraph;
103 }; 103 };
104 104
105 class OneLineSection final : public QWidget { 105 class OneLineSection final : public QWidget {
106 Q_OBJECT 106 Q_OBJECT
107 107
108 public: 108 public:
109 OneLineSection(const QString& title, const QString& data, QWidget* parent = nullptr); 109 OneLineSection(const QString& title, const QString& data, QWidget* parent = nullptr);
110 Header* GetHeader(); 110 Header* GetHeader();
111 Line* GetLine(); 111 Line* GetLine();
112 112
113 private: 113 private:
114 Header* header; 114 Header* header;
115 Line* line; 115 Line* line;
116 }; 116 };
117 117
118 } // namespace TextWidgets 118 } // namespace TextWidgets
119 119
120 #endif // __gui__ui_utils_h 120 #endif // __gui__ui_utils_h