comparison include/gui/widgets/text.h @ 83:d02fdf1d6708

*: huuuge update 1. make the now playing page function correctly 2. de-constructorfy many of our custom widgets, allowing them to be changed on-the-fly from the Now Playing page 3. ... :)
author Paper <mrpapersonic@gmail.com>
date Tue, 24 Oct 2023 22:01:02 -0400
parents 3364fadc8a36
children 8043152ef9d4
comparison
equal deleted inserted replaced
82:8b65c417c225 83:d02fdf1d6708
14 14
15 class Header : public QWidget { 15 class Header : public QWidget {
16 Q_OBJECT 16 Q_OBJECT
17 17
18 public: 18 public:
19 Header(QString title, QWidget* parent = nullptr); 19 Header(const QString& title, QWidget* parent = nullptr);
20 void SetText(QString title); 20 void SetText(const QString& title);
21 21
22 private: 22 private:
23 QLabel* static_text_title; 23 QLabel* static_text_title;
24 QFrame* static_text_line; 24 QFrame* static_text_line;
25 }; 25 };
26 26
27 class Paragraph : public QPlainTextEdit { 27 class Paragraph : public QPlainTextEdit {
28 Q_OBJECT 28 Q_OBJECT
29 29
30 public: 30 public:
31 Paragraph(QString text, QWidget* parent = nullptr); 31 Paragraph(const QString& text, QWidget* parent = nullptr);
32 void SetText(QString text); 32 void SetText(const QString& text);
33 QSize minimumSizeHint() const override; 33 QSize minimumSizeHint() const override;
34 QSize sizeHint() const override; 34 QSize sizeHint() const override;
35 }; 35 };
36 36
37 class Line : public QLineEdit { 37 class Line : public QLineEdit {
38 Q_OBJECT 38 Q_OBJECT
39 39
40 public: 40 public:
41 Line(QString text, QWidget* parent = nullptr); 41 Line(QWidget* parent = nullptr);
42 Line(const QString& text, QWidget* parent = nullptr);
43 void SetText(const QString& text);
42 }; 44 };
43 45
44 class Title : public Line { 46 class Title : public Line {
45 Q_OBJECT 47 Q_OBJECT
46 48
47 public: 49 public:
48 Title(QString title, QWidget* parent = nullptr); 50 Title(const QString& title, QWidget* parent = nullptr);
49 }; 51 };
50 52
51 class Section : public QWidget { 53 class Section : public QWidget {
52 Q_OBJECT 54 Q_OBJECT
53 55
54 public: 56 public:
55 Section(QString title, QString data, QWidget* parent = nullptr); 57 Section(const QString& title, const QString& data, QWidget* parent = nullptr);
56 Header* GetHeader(); 58 Header* GetHeader();
57 Paragraph* GetParagraph(); 59 Paragraph* GetParagraph();
58 60
59 private: 61 private:
60 Header* header; 62 Header* header;
63 65
64 class LabelledSection : public QWidget { 66 class LabelledSection : public QWidget {
65 Q_OBJECT 67 Q_OBJECT
66 68
67 public: 69 public:
68 LabelledSection(QString title, QString label, QString data, QWidget* parent = nullptr); 70 LabelledSection(const QString& title, const QString& label, const QString& data, QWidget* parent = nullptr);
69 Header* GetHeader(); 71 Header* GetHeader();
70 Paragraph* GetLabels(); 72 Paragraph* GetLabels();
71 Paragraph* GetParagraph(); 73 Paragraph* GetParagraph();
72 74
73 private: 75 private:
78 80
79 class SelectableSection : public QWidget { 81 class SelectableSection : public QWidget {
80 Q_OBJECT 82 Q_OBJECT
81 83
82 public: 84 public:
83 SelectableSection(QString title, QString data, QWidget* parent = nullptr); 85 SelectableSection(const QString& title, const QString& data, QWidget* parent = nullptr);
84 Header* GetHeader(); 86 Header* GetHeader();
85 Paragraph* GetParagraph(); 87 Paragraph* GetParagraph();
86 88
87 private: 89 private:
88 Header* header; 90 Header* header;
91 93
92 class OneLineSection : public QWidget { 94 class OneLineSection : public QWidget {
93 Q_OBJECT 95 Q_OBJECT
94 96
95 public: 97 public:
96 OneLineSection(QString title, QString data, QWidget* parent = nullptr); 98 OneLineSection(const QString& title, const QString& data, QWidget* parent = nullptr);
97 Header* GetHeader(); 99 Header* GetHeader();
98 Line* GetLine(); 100 Line* GetLine();
99 101
100 private: 102 private:
101 Header* header; 103 Header* header;