diff include/gui/widgets/text.h @ 83:d02fdf1d6708

*: huuuge update 1. make the now playing page function correctly 2. de-constructorfy many of our custom widgets, allowing them to be changed on-the-fly from the Now Playing page 3. ... :)
author Paper <mrpapersonic@gmail.com>
date Tue, 24 Oct 2023 22:01:02 -0400
parents 3364fadc8a36
children 8043152ef9d4
line wrap: on
line diff
--- a/include/gui/widgets/text.h	Mon Oct 23 13:37:42 2023 -0400
+++ b/include/gui/widgets/text.h	Tue Oct 24 22:01:02 2023 -0400
@@ -16,8 +16,8 @@
 		Q_OBJECT
 
 	public:
-		Header(QString title, QWidget* parent = nullptr);
-		void SetText(QString title);
+		Header(const QString& title, QWidget* parent = nullptr);
+		void SetText(const QString& title);
 
 	private:
 		QLabel* static_text_title;
@@ -28,8 +28,8 @@
 		Q_OBJECT
 
 	public:
-		Paragraph(QString text, QWidget* parent = nullptr);
-		void SetText(QString text);
+		Paragraph(const QString& text, QWidget* parent = nullptr);
+		void SetText(const QString& text);
 		QSize minimumSizeHint() const override;
 		QSize sizeHint() const override;
 };
@@ -38,21 +38,23 @@
 		Q_OBJECT
 
 	public:
-		Line(QString text, QWidget* parent = nullptr);
+		Line(QWidget* parent = nullptr);
+		Line(const QString& text, QWidget* parent = nullptr);
+		void SetText(const QString& text);
 };
 
 class Title : public Line {
 		Q_OBJECT
 
 	public:
-		Title(QString title, QWidget* parent = nullptr);
+		Title(const QString& title, QWidget* parent = nullptr);
 };
 
 class Section : public QWidget {
 		Q_OBJECT
 
 	public:
-		Section(QString title, QString data, QWidget* parent = nullptr);
+		Section(const QString& title, const QString& data, QWidget* parent = nullptr);
 		Header* GetHeader();
 		Paragraph* GetParagraph();
 
@@ -65,7 +67,7 @@
 		Q_OBJECT
 
 	public:
-		LabelledSection(QString title, QString label, QString data, QWidget* parent = nullptr);
+		LabelledSection(const QString& title, const QString& label, const QString& data, QWidget* parent = nullptr);
 		Header* GetHeader();
 		Paragraph* GetLabels();
 		Paragraph* GetParagraph();
@@ -80,7 +82,7 @@
 		Q_OBJECT
 
 	public:
-		SelectableSection(QString title, QString data, QWidget* parent = nullptr);
+		SelectableSection(const QString& title, const QString& data, QWidget* parent = nullptr);
 		Header* GetHeader();
 		Paragraph* GetParagraph();
 
@@ -93,7 +95,7 @@
 		Q_OBJECT
 
 	public:
-		OneLineSection(QString title, QString data, QWidget* parent = nullptr);
+		OneLineSection(const QString& title, const QString& data, QWidget* parent = nullptr);
 		Header* GetHeader();
 		Line* GetLine();