Mercurial > minori
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 45:4b05bc7668eb | 46:d0adc4aedfc8 |
|---|---|
| 1 #ifndef __gui__ui_utils_h | |
| 2 #define __gui__ui_utils_h | |
| 3 #include <QFrame> | |
| 4 #include <QLabel> | |
| 5 #include <QPlainTextEdit> | |
| 6 #include <QSize> | |
| 7 #include <QString> | |
| 8 #include <QWidget> | |
| 9 namespace TextWidgets { | |
| 10 void SetPlainTextEditData(QPlainTextEdit* text_edit, QString data); | |
| 11 | |
| 12 class Header : public QWidget { | |
| 13 Q_OBJECT | |
| 14 | |
| 15 public: | |
| 16 Header(QString title, QWidget* parent = nullptr); | |
| 17 void SetTitle(QString title); | |
| 18 | |
| 19 private: | |
| 20 QLabel* static_text_title; | |
| 21 QFrame* static_text_line; | |
| 22 }; | |
| 23 | |
| 24 class Paragraph : public QPlainTextEdit { | |
| 25 Q_OBJECT | |
| 26 | |
| 27 public: | |
| 28 Paragraph(QString text, QWidget* parent = nullptr); | |
| 29 QSize minimumSizeHint() const override; | |
| 30 QSize sizeHint() const override; | |
| 31 }; | |
| 32 | |
| 33 /* technically a paragraph and a heading is actually a | |
| 34 "section", but that name is equally as confusing as | |
| 35 "text paragraph". */ | |
| 36 class TextParagraph : public QWidget { | |
| 37 Q_OBJECT | |
| 38 | |
| 39 public: | |
| 40 TextParagraph(QString title, QString data, QWidget* parent = nullptr); | |
| 41 Header* GetHeader(); | |
| 42 Paragraph* GetParagraph(); | |
| 43 | |
| 44 private: | |
| 45 Header* header; | |
| 46 Paragraph* paragraph; | |
| 47 }; | |
| 48 | |
| 49 class LabelledTextParagraph : public QWidget { | |
| 50 Q_OBJECT | |
| 51 | |
| 52 public: | |
| 53 LabelledTextParagraph(QString title, QString label, QString data, QWidget* parent = nullptr); | |
| 54 Header* GetHeader(); | |
| 55 Paragraph* GetLabels(); | |
| 56 Paragraph* GetParagraph(); | |
| 57 | |
| 58 private: | |
| 59 Header* header; | |
| 60 Paragraph* labels; | |
| 61 Paragraph* paragraph; | |
| 62 }; | |
| 63 | |
| 64 class SelectableTextParagraph : public QWidget { | |
| 65 Q_OBJECT | |
| 66 | |
| 67 public: | |
| 68 SelectableTextParagraph(QString title, QString data, QWidget* parent = nullptr); | |
| 69 Header* GetHeader(); | |
| 70 Paragraph* GetParagraph(); | |
| 71 | |
| 72 private: | |
| 73 Header* header; | |
| 74 Paragraph* paragraph; | |
| 75 }; | |
| 76 }; // namespace UiUtils | |
| 77 #endif // __gui__ui_utils_h |
