diff include/gui/widgets/text.h @ 365:f81bed4e04ac

*: megacommit that probably breaks things
author Paper <paper@paper.us.eu.org>
date Wed, 02 Oct 2024 23:06:43 -0400
parents 6b0768158dcd
children
line wrap: on
line diff
--- a/include/gui/widgets/text.h	Tue Jul 16 21:15:59 2024 -0400
+++ b/include/gui/widgets/text.h	Wed Oct 02 23:06:43 2024 -0400
@@ -30,6 +30,21 @@
 	QPointer<QFrame> separator_;
 };
 
+class Label final : public QLabel {
+	Q_OBJECT
+
+public:
+	Label(QWidget *parent = nullptr);
+	Label(const QString &string, QWidget *parent = nullptr);
+	void SetElidingMode(bool elide);
+
+protected:
+	void paintEvent(QPaintEvent *event) override;
+
+private:
+	bool elide_;
+};
+
 /* This is a nice clean wrapper around Label suitable for our needs. */
 class Paragraph : public QWidget {
 	Q_OBJECT
@@ -65,7 +80,7 @@
 	QPointer<QWidget> contents_;
 	QPointer<QGridLayout> contents_layout_;
 
-	std::vector<std::pair<QSharedPointer<QLabel>, QSharedPointer<QLabel>>> data_;
+	std::vector<std::pair<QSharedPointer<Label>, QSharedPointer<Label>>> data_;
 };
 
 /* this is just a generic QLabel with a specific font and foreground role,