comparison include/gui/widgets/text.h @ 64:fe719c109dbc

*: update 1. add media tracking ability, and it displays info on the `now playing` page 2. the `now playing` page now actually shows something 3. renamed every page class to be more accurate to what it is 4. ...
author Paper <mrpapersonic@gmail.com>
date Sun, 01 Oct 2023 23:15:43 -0400
parents 3d2decf093bb
children 27a19dd6cba1
comparison
equal deleted inserted replaced
63:3d2decf093bb 64:fe719c109dbc
1 #ifndef __gui__ui_utils_h 1 #ifndef __gui__ui_utils_h
2 #define __gui__ui_utils_h 2 #define __gui__ui_utils_h
3
3 #include <QFrame> 4 #include <QFrame>
4 #include <QLabel> 5 #include <QLabel>
5 #include <QPlainTextEdit> 6 #include <QPlainTextEdit>
6 #include <QSize> 7 #include <QSize>
7 #include <QString> 8 #include <QString>
8 #include <QWidget> 9 #include <QWidget>
10
9 namespace TextWidgets { 11 namespace TextWidgets {
10 void SetPlainTextEditData(QPlainTextEdit* text_edit, QString data);
11 12
12 class Header : public QWidget { 13 class Header : public QWidget {
13 Q_OBJECT 14 Q_OBJECT
14 15
15 public: 16 public:
16 Header(QString title, QWidget* parent = nullptr); 17 Header(QString title, QWidget* parent = nullptr);
17 void SetTitle(QString title); 18 void SetText(QString title);
18 19
19 private: 20 private:
20 QLabel* static_text_title; 21 QLabel* static_text_title;
21 QFrame* static_text_line; 22 QFrame* static_text_line;
22 }; 23 };
24 class Paragraph : public QPlainTextEdit { 25 class Paragraph : public QPlainTextEdit {
25 Q_OBJECT 26 Q_OBJECT
26 27
27 public: 28 public:
28 Paragraph(QString text, QWidget* parent = nullptr); 29 Paragraph(QString text, QWidget* parent = nullptr);
30 void SetText(QString text);
29 QSize minimumSizeHint() const override; 31 QSize minimumSizeHint() const override;
30 QSize sizeHint() const override; 32 QSize sizeHint() const override;
31 }; 33 };
32 34
33 /* technically a paragraph and a heading is actually a 35 /* technically a paragraph and a heading is actually a
71 73
72 private: 74 private:
73 Header* header; 75 Header* header;
74 Paragraph* paragraph; 76 Paragraph* paragraph;
75 }; 77 };
76 }; // namespace TextWidgets 78
79 class Title : public Paragraph {
80 Q_OBJECT
81
82 public:
83 Title(QString title, QWidget* parent = nullptr);
84 };
85
86 } // namespace TextWidgets
87
77 #endif // __gui__ui_utils_h 88 #endif // __gui__ui_utils_h