Mercurial > minori
diff include/gui/widgets/text.h @ 291:9a88e1725fd2
*: refactor lots of stuff
I forgot to put this into different commits, oops!
anyway, it doesn't really matter *that* much since this is an
unfinished hobby project anyway. once it starts getting stable
commit history will be more important, but for now it's not
that big of a deal
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 12 May 2024 16:31:07 -0400 |
parents | 3ec7804abf17 |
children | b82841e76e79 |
line wrap: on
line diff
--- a/include/gui/widgets/text.h Wed May 08 17:32:28 2024 -0400 +++ b/include/gui/widgets/text.h Sun May 12 16:31:07 2024 -0400 @@ -21,16 +21,24 @@ void SetText(const QString& title); private: - QLabel* static_text_title; - QFrame* static_text_line; + QLabel static_text_title; + QFrame static_text_line; }; -class Paragraph : public QLabel { +class Paragraph : public QWidget { Q_OBJECT public: Paragraph(const QString& text, QWidget* parent = nullptr); void SetText(const QString& text); + QPlainTextEdit* GetLabel(); + +protected: + QSize minimumSizeHint() const; + QSize sizeHint() const; + +private: + QPlainTextEdit text_edit; }; class LabelledParagraph final : public QWidget { @@ -38,21 +46,27 @@ public: LabelledParagraph(const QString& label, const QString& data, QWidget* parent = nullptr); - Paragraph* GetLabels(); - Paragraph* GetParagraph(); + QLabel* GetLabels(); + QLabel* GetData(); + + /* synonymous with GetData(), kept for compatibility. don't use in new code!!! */ + QLabel* GetParagraph(); private: - Paragraph* labels; - Paragraph* paragraph; + QLabel labels_; + QLabel data_; }; -class Line : public Paragraph { +class Line : public QWidget { Q_OBJECT public: Line(QWidget* parent = nullptr); Line(const QString& text, QWidget* parent = nullptr); void SetText(const QString& text); + +protected: + QLineEdit line_edit_; }; class Title final : public Line { @@ -81,8 +95,9 @@ public: LabelledSection(const QString& title, const QString& label, const QString& data, QWidget* parent = nullptr); Header* GetHeader(); - Paragraph* GetLabels(); - Paragraph* GetParagraph(); + QLabel* GetLabels(); + QLabel* GetData(); + QLabel* GetParagraph(); private: Header* header;