Mercurial > minori
diff src/include/ui_utils.h @ 7:07a9095eaeed
Update
Refactored some code, moved some around
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Thu, 24 Aug 2023 23:11:38 -0400 |
parents | 1d82f6e04d7d |
children | b1f73678ef61 |
line wrap: on
line diff
--- a/src/include/ui_utils.h Wed Aug 16 00:49:17 2023 -0400 +++ b/src/include/ui_utils.h Thu Aug 24 23:11:38 2023 -0400 @@ -6,13 +6,22 @@ #include <QSize> #include <QDateTime> #include <QIcon> +#include <QPlainTextEdit> namespace UiUtils { QIcon CreateSideBarIcon(const char* file); bool IsInDarkMode(); std::string GetLengthFromQDateTime(QDateTime stamp); - QPlainTextEdit* CreateTextParagraph(QWidget* parent, QString title, QString data, QPoint point, QSize size); - QPlainTextEdit* CreateTextParagraphWithLabels(QWidget* parent, QString title, QString label, QString data, QPoint point, QSize size); - QPlainTextEdit* CreateSelectableTextParagraph(QWidget* parent, QString title, QString data, QPoint point, QSize size); - void CreateTextHeader(QWidget* parent, QString title, QPoint point, QSize size); + QPlainTextEdit* CreateTextParagraph(QWidget* parent, QString title, QString data); + QPlainTextEdit* CreateTextParagraphWithLabels(QWidget* parent, QString title, QString label, QString data); + QPlainTextEdit* CreateSelectableTextParagraph(QWidget* parent, QString title, QString data); + void SetPlainTextEditData(QPlainTextEdit* text_edit, QString data); + void CreateTextHeader(QWidget* parent, QString title); +}; + +class Paragraph : public QPlainTextEdit { + public: + Paragraph(QString text, QWidget* parent = nullptr); + QSize minimumSizeHint() const override; + QSize sizeHint() const override; }; #endif // __ui_utils_h \ No newline at end of file