Mercurial > minori
comparison include/gui/widgets/text.h @ 253:b3549da699a6
*: ooooh! stupid big commit!
oops
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Tue, 06 Feb 2024 16:56:32 -0500 |
| parents | 8043152ef9d4 |
| children | 862d0d8619f6 |
comparison
equal
deleted
inserted
replaced
| 252:a0eeb2cc7e6d | 253:b3549da699a6 |
|---|---|
| 6 #include <QSize> | 6 #include <QSize> |
| 7 #include <QString> | 7 #include <QString> |
| 8 #include <QWidget> | 8 #include <QWidget> |
| 9 | 9 |
| 10 class QFrame; | 10 class QFrame; |
| 11 class QLabel; | 11 |
| 12 #include <QLabel> | |
| 12 | 13 |
| 13 namespace TextWidgets { | 14 namespace TextWidgets { |
| 14 | 15 |
| 15 class Header : public QWidget { | 16 class Header : public QWidget { |
| 16 Q_OBJECT | 17 Q_OBJECT |
| 22 private: | 23 private: |
| 23 QLabel* static_text_title; | 24 QLabel* static_text_title; |
| 24 QFrame* static_text_line; | 25 QFrame* static_text_line; |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 class Paragraph : public QPlainTextEdit { | 28 class Paragraph : public QLabel { |
| 28 Q_OBJECT | 29 Q_OBJECT |
| 29 | 30 |
| 30 public: | 31 public: |
| 31 Paragraph(const QString& text, QWidget* parent = nullptr); | 32 Paragraph(const QString& text, QWidget* parent = nullptr); |
| 32 void SetText(const QString& text); | 33 void SetText(const QString& text); |
| 33 QSize minimumSizeHint() const override; | |
| 34 QSize sizeHint() const override; | |
| 35 }; | 34 }; |
| 36 | 35 |
| 37 class Line : public QLineEdit { | 36 class LabelledParagraph final : public QWidget { |
| 38 Q_OBJECT | 37 Q_OBJECT |
| 39 | 38 |
| 40 public: | 39 public: |
| 41 Line(QWidget* parent = nullptr); | 40 LabelledParagraph(const QString& label, const QString& data, QWidget* parent = nullptr); |
| 42 Line(const QString& text, QWidget* parent = nullptr); | 41 Paragraph* GetLabels(); |
| 43 void SetText(const QString& text); | 42 Paragraph* GetParagraph(); |
| 43 | |
| 44 private: | |
| 45 Paragraph* labels; | |
| 46 Paragraph* paragraph; | |
| 47 }; | |
| 48 | |
| 49 class Line : public Paragraph { | |
| 50 Q_OBJECT | |
| 51 | |
| 52 public: | |
| 53 Line(QWidget* parent = nullptr); | |
| 54 Line(const QString& text, QWidget* parent = nullptr); | |
| 55 void SetText(const QString& text); | |
| 44 }; | 56 }; |
| 45 | 57 |
| 46 class Title final : public Line { | 58 class Title final : public Line { |
| 47 Q_OBJECT | 59 Q_OBJECT |
| 48 | 60 |
| 72 Paragraph* GetLabels(); | 84 Paragraph* GetLabels(); |
| 73 Paragraph* GetParagraph(); | 85 Paragraph* GetParagraph(); |
| 74 | 86 |
| 75 private: | 87 private: |
| 76 Header* header; | 88 Header* header; |
| 77 Paragraph* labels; | 89 LabelledParagraph* content; |
| 78 Paragraph* paragraph; | |
| 79 }; | 90 }; |
| 80 | 91 |
| 81 class SelectableSection final : public QWidget { | 92 class SelectableSection final : public QWidget { |
| 82 Q_OBJECT | 93 Q_OBJECT |
| 83 | 94 |
